import{bh as e,O as t,B as n,bi as i,bj as a,bk as s,_ as o,bl as r,I as l,bm as c,M as p,bn as h,bo as m,bp as d,bq as u,br as _,bs as y,bt as f,bu as b,bv as g,bw as v,bx as C,P as w,by as P,a_ as k,aZ as T,t as L,ar as x,d as I,aB as S,aD as q,aA as M,aC as E,as as A,D as B,bz as F,bA as O,bB as R,aR as N,e as z,bC as V,bD as $,bE as W,b9 as j,ba as H,bF as Z}from"./chunk.common_CTPs4D8t.esm.js";import{g as D,b as U}from"./client.login-button_BXY0vbFt.en.esm.js";const Y=(e,t)=>t.every((t=>t in e));function J(t,n){return null!=t&&("cart"===(null==t?void 0:t.type)?function(t,n){const i=Y(t,["min_price","max_price","price","eligible","number_of_payment_terms","available_loan_types"]);i||n(e.Cart,JSON.stringify(t))}(t,n):function(t,n){var i;const a=Y(t,["variants","max_price","min_price","number_of_payment_terms"]),s=(null===(i=t.variants)||void 0===i?void 0:i.length)>0&&Y(t.variants[0],["id","price","eligible","available_loan_types","available"]);a&&s||n(e.Product,JSON.stringify(t))}(t,n),Y(t,["min_price","max_price"]))}function Q(t,n){return null!=t&&(t.type===e.Cart?function(t,n){const i=Y(t,["min_price","max_price","price_per_term","eligible","number_of_payment_terms","full_price","financing_plans"]);if(!i)return null==n||n(e.Cart,JSON.stringify(t)),!1;return!0}(t,n):t.type===e.Checkout?function(t,n){const i=Y(t,["min_price","max_price","price_per_term","eligible","number_of_payment_terms","full_price","financing_plans"]);if(!i)return null==n||n(e.Checkout,JSON.stringify(t)),!1;return!0}(t,n):function(t,n){var i;const a=Y(t,["variants","max_price","min_price","financing_plans"]),s=(null===(i=t.variants)||void 0===i?void 0:i.length)>0&&Y(t.variants[0],["id","price_per_term","eligible","full_price","available"]);if(!a||!s)return null==n||n(e.Product,JSON.stringify(t)),!1;return!0}(t,n))}class K extends HTMLElement{static get observedAttributes(){return["variant-id","shopify-meta"]}constructor(){super(),this._didMount=!1,this._currentBanner=document.createElement("div"),this.attachShadow({mode:"open"})}connectedCallback(){var e;const t=this._getNewBannerNode();this.shadowRoot||n.notify(new Error("ShopifyPaymentTerms: shadowRoot is null.")),null===(e=this.shadowRoot)||void 0===e||e.appendChild(t),this._currentBanner=t,this._didMount=!0}attributeChangedCallback(){var e;if(this._didMount){const t=this._getNewBannerNode();null===(e=this.shadowRoot)||void 0===e||e.replaceChild(t,this._currentBanner),this._currentBanner=t}}disconnectedCallback(){var e,t;(null===(e=this.shadowRoot)||void 0===e?void 0:e.contains(this._currentBanner))&&(null===(t=this.shadowRoot)||void 0===t||t.removeChild(this._currentBanner))}_getNewBannerNode(){const e=this.getAttribute("shopify-meta"),t=this.getAttribute("variant-id"),n=Boolean(e&&Q(JSON.parse(e))),i=document.createElement(n?"shop-pay-installments-banner":"shop-pay-banner");return t&&i.setAttribute("variant-id",t),e&&i.setAttribute("shopify-meta",e),i}}const G='\n \n

\n \n \n \n \n \n \n \n \n \n

\n',X=e=>``,ee="Affirm",te="\n#shopify-payment-terms-modal .visually-hidden {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n#shopify-payment-terms-modal .modal-wrapper {\n max-width: 432px;\n}\n\n#shopify-payment-terms-modal p {\n font-size: 18px;\n line-height: 150%;\n}\n\n#shopify-payment-terms-modal section {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,\n Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';\n}\n\n#shopify-payment-terms-modal .price {\n color: rgb(90, 49, 244);\n font-weight: 600;\n display: inline-flex;\n flex-direction: column;\n line-height: 1;\n align-items: center;\n}\n\n#shopify-payment-terms-modal .price__icon {\n width: 43px;\n height: 10px;\n}\n\n#shopify-payment-terms-modal .list {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n\n#shopify-payment-terms-modal .list-item__subheading {\n font-size: 14px;\n line-height: 140%;\n color: rgba(0, 0, 0, 0.7);\n}\n\n#shopify-payment-terms-modal .btn__close--icon {\n display: inline-flex;\n flex-shrink: 0;\n padding: 16px;\n border-radius: 6px;\n}\n\n#shopify-payment-terms-modal .btn__close--icon:hover,\n#shopify-payment-terms-modal .btn__close--icon:active,\n#shopify-payment-terms-modal .btn__close--icon:focus {\n background-color: rgb(244, 241, 254);\n color: rgb(63, 34, 171);\n}\n\n#shopify-payment-terms-modal .help_text {\n margin-bottom: 19px;\n margin-top: 16px;\n font-size: 11px;\n line-height: 14px;\n color: rgba(0, 0, 0, 0.6);\n}\n\n#shopify-payment-terms-modal .help_text small {\n color: inherit;\n letter-spacing: 0.04rem;\n font-weight: 300;\n font-size: 11px;\n}\n\n#shopify-payment-terms-modal .help_text__link {\n color: rgba(0, 0, 0, 0.6);\n text-decoration: underline;\n}\n\n#shopify-payment-terms-modal .help_text__link:hover,\n#shopify-payment-terms-modal .help_text__link:active,\n#shopify-payment-terms-modal .help_text__link:focus {\n color: rgb(63, 34, 171);\n}\n\n#shopify-payment-terms-modal .tagline__bold {\n font-weight: 700;\n}\n\n#shopify-payment-terms-modal footer, #shopify-payment-terms-cover footer {\n text-align: center;\n}\n\n#shopify-payment-terms-modal .shop-pay-logo-wrapper,\n#shopify-payment-terms-cover .shop-pay-logo-wrapper {\n margin-bottom: 12px;\n}\n\n#shopify-payment-terms-modal .close__icon {\n width: 13px;\n height: 13px;\n}\n\n.affirm-logo,\n#shopify-payment-terms-modal .affirm-logo,\n#shopify-payment-terms-cover .affirm-logo {\n width: 39px;\n height: 21px;\n padding-left: 4px;\n box-sizing: content-box;\n}\n\n.affirm-logo-inline,\n#shopify-payment-terms-modal .affirm-logo-inline,\n#shopify-payment-terms-cover .affirm-logo-inline {\n margin-bottom: -6px;\n padding-left: 0px;\n}\n\n.affirm-text,\n#shopify-payment-terms-modal .affirm-text,\n#shopify-payment-terms-cover .affirm-text {\n display: flex;\n font-size: 12px;\n font-weight: 300;\n line-height: 150%;\n color: rgba(0, 0, 0, 0.6);\n justify-content: center;\n align-items: center;\n}\n\n.affirm-text small,\n#shopify-payment-terms-modal .affirm-text small,\n#shopify-payment-terms-cover .affirm-text small {\n font-size: 11px;\n letter-spacing: 0.04rem;\n line-height: 14px;\n}\n",ne="Failed to construct 'HTMLElement': This instance is already constructed";class ie{constructor(e){this._documentFocusHandler=e=>{this._lastFocusable&&e.target!==this._getShadowRootHost()&&!this._isEventFromModal(e)&&(e.preventDefault(),e.stopPropagation(),this._lastFocusable.focus())},this._shadowRootFocusHandler=e=>{this._firstFocusable&&e.target===this._phantomElement&&this._firstFocusable.focus()},this._htmlElement=e}lock(){const e=this._htmlElement.querySelectorAll('a[href], button:not([disabled]):not([tabindex="-1"]');this._firstFocusable=e[0],this._lastFocusable=e[e.length-1],this._phantomElement=this._createPhantomElement(),this._htmlElement.appendChild(this._phantomElement),this._htmlElement.addEventListener("focus",this._shadowRootFocusHandler,!0),document.addEventListener("focus",this._documentFocusHandler,!0)}release(e={}){this._htmlElement.removeEventListener("focus",this._shadowRootFocusHandler,!0),document.removeEventListener("focus",this._documentFocusHandler,!0),this._removePhantomElement(),e instanceof HTMLElement&&e.focus()}_createPhantomElement(){const e=document.createElement("button");return e.setAttribute("aria-hidden","true"),e.className="visually-hidden",e}_removePhantomElement(){this._phantomElement&&this._htmlElement.removeChild(this._phantomElement)}_isEventFromModal(e){const t=e.composedPath().find((e=>e instanceof Element&&e.ariaModal));return Boolean(t)}_getShadowRootHost(){const e=this._htmlElement.getRootNode();return e instanceof ShadowRoot?e.host:null}}function ae(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2}).format(e)}function se(){var e,t,n;switch(null===(n=null===(t=null===(e=window.Shopify)||void 0===e?void 0:e.theme)||void 0===t?void 0:t.name)||void 0===n?void 0:n.toLowerCase()){case"boundless":case"brooklyn":return".cart__subtotal";case"dawn":return".totals__subtotal-value, .sections.cart.new_subtotal";case"debut":return".cart-subtotal__price";case"express":return".cart__subtotal, .cart-drawer__subtotal-value";case"minimal":return".h5.cart__subtotal-price";case"narrative":return".cart-subtotal__price, .cart-drawer__subtotal-number";case"simple":return".cart__subtotal.h3";case"supply":return".h1.cart-subtotal--price";case"venture":return".CartSubtotal"}return null}function oe(){document.querySelector("[data-cart-subtotal]")||console.warn("[Shop Pay Installments] Cart price updates may not be handled automatically for this theme. To ensure the price shown in the Shop Pay Installments banner is updated correctly, follow the instructions found here: https://shopify.dev/themes/pricing-payments/installments#updating-the-banner-with-cart-total-changes")}function re(e){var t,n,i;const a="#FFF";if(!e)return a;const s=e.host.parentElement&&(null===(t=getComputedStyle(e.host.parentElement).getPropertyValue("--payment-terms-background-color"))||void 0===t?void 0:t.trim()),o=null===(n=getComputedStyle(document.documentElement).getPropertyValue("--payment-terms-background-color"))||void 0===n?void 0:n.trim(),r=null===(i=getComputedStyle(document.documentElement).getPropertyValue("--color-body"))||void 0===i?void 0:i.trim(),l=s||o||r;return l&&CSS.supports("color",l)?l:a}function le(e){return parseFloat(e.replace(/[^0-9.]/g,""))}function ce(e){const t=e.querySelector('select[name^="id"]')||e.querySelector('[name^="id"]');return t?Number(t.value):function(){const e=new URL(document.location.href).searchParams.get("variant");return e?Number(e):void 0}()}function pe(e){const t='';return e.isEnglish()?e.translate("modal.partnership",{affirmLogo:t}):e.translate("modal.partnership_disclaimer",{affirmLogo:t})}function he(e,t,n){return{subTitle:e.translate("modal.subtitle.dynamic_pdp",{count:t,priceWithoutInterest:n}),legalCopy:e.translate("modal.legal.dynamic_pdp")}}function me(e,t){return e.map((({pricePerTerm:e,apr:n,numberOfPaymentTerms:i,loanType:a})=>{const s=le(e)*i,o=le(t);return{pricePerTerm:e,apr:n,numberOfPaymentTerms:i,interest:ae(0===n?0:s-o),totalPriceWithInterest:ae(0===n?o:s),loanType:a}}))}function de(e,t,n,i){const s=e.translate("modal.title"),o=e.translate("modal.sample_plan_contents.check_eligibility"),r=e.translate("modal.sample_plan_contents.interest"),l=e.translate("modal.sample_plan_contents.total"),c=e.translate("modal.sample_plan_contents.processing"),p=e.translate("modal.sample_plan_contents.processing_time"),h=pe(e),m=e.translate("modal.new_window"),d=e.translate("modal.close");return`\n \n
\n
\n
\n

${c}

\n

${p}

\n
\n
\n
\n ${_e(h)}\n ${ye()}\n
\n
\n
\n
\n \n \n `}function ue(e,t,n,i,a){return`\n \n `}function _e(e){return`\n
\n \n
\n
\n \n ${e}\n \n
`}function ye(){return''}function fe(e){if(!e||""===e.trim())return[];const t=e=>"CSSFontFaceRule"===e.constructor.name;try{const n=[...document.styleSheets].filter((e=>{try{return Boolean(e.cssRules)}catch(e){return!1}})).flatMap((e=>[...e.cssRules].filter(t))).filter((t=>e.includes(t.style.getPropertyValue("font-family")))).map((e=>{const t={};for(let n=e.style.length;n--;){const i=e.style[n];t[i]=e.style.getPropertyValue(i)}const n=e.style.getPropertyValue("src");return n&&(t.src=n.replace(/url\((["']?)([^"')]+)\1\)/gm,((t,n,i)=>{var a,s;if(i.match(/^(https?:)?\/\//))return t;{const t=null!==(s=null===(a=e.parentStyleSheet)||void 0===a?void 0:a.href)&&void 0!==s?s:location.href;return`url("${new URL(i,t).toString()}")`}}))),t})),i=e=>{if(!e)return{};const t=new Map([["font-weight","weight"],["font-display","display"],["font-style","style"],["font-stretch","stretch"],["ascent-override","ascentOverride"],["descent-override","descentOverride"],["font-feature-settings","featureSettings"],["line-gap-override","lineGapOverride"],["unicode-range","unicodeRange"]]),n={};return t.forEach(((t,i)=>{e[i]&&(n[t]=e[i])})),n};return(null!=n?n:[]).map((e=>({src:e.src,fontFamily:e["font-family"].replace(/["']/g,""),fontFaceDescriptors:i(e)})))}catch(e){return[]}}class be extends HTMLElement{constructor(e,t,n,i,a,o,r,l,c){super(),this._i18n=null,this._trackContinueToCheckout=!0,this._initialized=!1,this.handleClose=()=>{this._monorailTracker.trackModalAction(this._modalToken,s.Close);const e=new Event("shopify_modal_close");this.dispatchEvent(e)},this.handleEscKey=e=>{"Escape"!==e.key&&"Esc"!==e.key||this.handleClose()},this.handleContinueToCheckout=()=>{this._trackContinueToCheckout&&this._monorailTracker.trackModalAction(this._modalToken,s.ContinueToCheckout)},this._loanTypes=i,this._eligible=t,this._modalToken=a,this._monorailTracker=o,this._pricePerTerm=e,this._priceRange=n,this._priceWithoutInterest=r,this._minIneligibleMessageType=l,this._numberOfPaymentTerms=c,this.attachShadow({mode:"open",delegatesFocus:!0})}get focusLockTarget(){return this.rootContainer.querySelector("#shopify-payment-terms-modal")}get rootContainer(){return this.shadowRoot}connectedCallback(){return o(this,void 0,void 0,(function*(){this._initialized||(yield this._initTranslations(),yield this._initContent(),this._closeButtons=this.rootContainer.querySelectorAll(".btn__close"),this._closeButtons&&0!==this._closeButtons.length&&(this._closeButtons.forEach((e=>e.addEventListener("click",this.handleClose))),this._closeButtons[0].focus(),window.addEventListener("keydown",this.handleEscKey),this._initialized=!0))}))}disconnectedCallback(){this._closeButtons&&(this._closeButtons.forEach((e=>e.removeEventListener("click",this.handleClose))),window.removeEventListener("keydown",this.handleEscKey))}get price(){return this.getAttribute("price")||""}set price(e){this.setAttribute("price",e)}getModalToken(){return this._modalToken}getModalType(){var e;return(null===(e=this._loanTypes)||void 0===e?void 0:e.length)&&this._eligible?this._loanTypes.includes(a.Interest)&&this._loanTypes.includes(a.SplitPay)?r.Adaptive:this._loanTypes.includes(a.SplitPay)?r.SplitPay:r.InterestOnly:r.Ineligible}determineListItemsByLoanTypes(e){return this._i18n?e&&e.includes(a.Interest)?[this._i18n.translate("modal.split_pay_contents.interest_fees"),this._i18n.translate("modal.split_pay_contents.interest_credit")]:[this._i18n.translate("modal.split_pay_contents.no_interest_fees"),this._i18n.translate("modal.split_pay_contents.no_interest_credit")]:["",""]}determineTextByLoanTypes(e,t,n,i,s,o){if(!this._i18n)return{subTitle:"",legalCopy:""};if(!e||!i)return this.getIneligibleMessage(n,o,s);if(e.includes(a.Interest)&&e.includes(a.SplitPay)){const e=[this._i18n.translate("modal.legal.interest_and_split_pay"),this._i18n.translate("modal.legal.rates_from_apr"),this._i18n.translate("modal.legal.ca_residents_notice")].filter(Boolean).join(" ");return{subTitle:this._i18n.translate("modal.subtitle.interest_and_split_pay",{splitPayLoanRepayment:t}),legalCopy:e}}if(e.includes(a.SplitPay)){const e=[this._i18n.translate("modal.legal.split_pay_only"),this._i18n.translate("modal.legal.ca_residents_notice")].filter(Boolean).join(" ");let n="modal.subtitle.split_pay_only";2===this._numberOfPaymentTerms?n="modal.subtitle.split_pay_only_2":1===this._numberOfPaymentTerms&&(n="modal.subtitle.split_pay_only_30");return{subTitle:this._i18n.translate(n,{price:o,splitPayLoanRepayment:t}),legalCopy:e}}if(e.includes(a.Interest)){const e=[this._i18n.translate("modal.legal.rates_from_apr"),this._i18n.translate("modal.legal.ca_residents_notice")].filter(Boolean).join(" ");return{subTitle:this._i18n.translate("modal.subtitle.interest_only"),legalCopy:e}}return this.getIneligibleMessage(n,o,s)}getIneligibleMessage(e,t,n){if(!this._i18n)return{subTitle:"",legalCopy:""};const a=null==e?void 0:e.minPrice,s=null==e?void 0:e.maxPrice,o=a?le(a):null,r=t?le(t):null,l=[this._i18n.translate("modal.legal.ineligible"),this._i18n.translate("modal.legal.ca_residents_notice")].filter(Boolean).join(" ");if(!o||!s)return{subTitle:"",legalCopy:l};if(!r||r{price} with {shopPayLogo}",split_pay_eligible_2:"Pay in 2 interest-free installments of {price} with {shopPayLogo}",split_pay_eligible_30:"Pay {price} within 30 days interest-free with {shopPayLogo}",interest_only_eligible:"Split your purchase into monthly installments with {shopPayLogo}",dynamic_interest_only_eligible:"From {price}/mo with {shopPayLogo}",pay_in_4_or_as_low_as_eligible:"4 interest-free installments, or from {price}/mo with {shopPayLogo}",zero_interest_eligible:"From {price}/mo or 0% APR with {shopPayLogo}",zero_interest_eligible_zero_apr:"From {price}/mo at 0% APR with {shopPayLogo}",non_eligible_min:"Pay in 4 interest-free installments for orders over {minPrice} with {shopPayLogo}",non_eligible_min_over_time:"Pay over time for orders over {minPrice} with {shopPayLogo}",non_eligible_min_over_time_30:"Pay within 30 days interest-free for orders over {minPrice} with {shopPayLogo}",non_eligible_monthly_payments_min:"Split your purchase into monthly installments for orders over {minPrice} with {shopPayLogo}",non_eligible_max:"Split your purchase into installments for orders up to {maxPrice} with {shopPayLogo}",prequal_contents:{not_prequalified_see_plans:"Check your purchasing power",prequalified_see_plans:"See plans",purchasing_power_a:"Your purchasing power is ",purchasing_power_b:"Spend any amount up to "}},modal:{title:"Get it now, pay later",subtitle:{interest_and_split_pay:'Choose your payment schedule at checkout – starting at 4 interest-free payments of {splitPayLoanRepayment} every 2 weeks.',interest_only:"Choose your payment schedule at checkout to split your purchase into monthly installments.",split_pay_only:'Select installments at checkout to split your purchase into 4 interest-free payments of {splitPayLoanRepayment} every 2 weeks.',split_pay_only_2:'Select installments at checkout to split your purchase into 2 interest-free payments of {splitPayLoanRepayment} every 15 days.',split_pay_only_30:"Select installments at checkout to pay for your purchase of {price} interest-free within 30 days.",ineligible_min:"For orders over {minPrice}, select installments at checkout to split your purchase into 4 interest-free payments.",ineligible_min_over_time:"For orders over {minPrice}, select installments at checkout to split your purchase over time.",ineligible_monthly_payments_min:"For orders over {minPrice}, select installments at checkout to split your purchase into monthly payments.",ineligible_max:"For orders up to {maxPrice}, select installments at checkout to split your purchase into multiple payments.",dynamic_pdp:{one:"Sample plan for {priceWithoutInterest} purchase",other:"Sample plans for {priceWithoutInterest} purchase"}},close:"Close",new_window:"Opens in a new window.",partnership:"Installments in partnership with {affirmLogo}",partnership_disclaimer:"Installments in partnership with {affirmLogo}. Translation services are not provided by Affirm. Affirm and its offerings are only supported in English.",split_pay_contents:{interest_fees:"No hidden fees, ever.",interest_credit:"No impact on your credit score to apply.",no_interest_fees:"No fees, ever.",no_interest_credit:"No impact on your credit score to apply."},sample_plan_contents:{continue_to_checkout:"Continue to checkout",unavailable:"Unavailable",check_eligibility:"By continuing, your information will be shared with Affirm.
Checking your qualification won’t affect your credit. ",apr:"APR",interest:"Interest",total:"Total",processing:"Processing your request",processing_time:"This can take up to a minute...",split_pay_frequency:'{pricePerTerm}  every 2 weeks',other_frequency:'{pricePerTerm}  every month',split_pay_number_of_terms:" for {numberOfTerms} weeks",other_number_of_terms:" for {numberOfTerms} months"},prequal_contents:{unavailable:"Unavailable",check:"Check if you qualify"},legal:{ca_residents_notice:"CA Residents: Loans by Affirm Loan Services, LLC are made or arranged pursuant to a California Finance Lender license.",rates_from_apr:'Rates from 0-36% APR. Payment options through Affirm are subject to an eligibility check, may not be available in all states, and are provided by these lending partners: affirm.com/lenders. Options depend on your purchase amount, and a down payment may be required.',interest_and_split_pay:"The estimated payment amount excludes taxes and shipping.",split_pay_only:"The estimated payment amount excludes taxes and shipping. Payment options are offered by Affirm and are subject to an eligibility check and might not be available in all states.",ineligible:"Payment options are offered by Affirm and are subject to an eligibility check and might not be available in all states.",dynamic_pdp:'The estimated payment amount excludes taxes and shipping. Rates range from 0-36% APR. Payment options through Shop Pay Installments are subject to an eligibility check and are provided by these lending partners: affirm.com/lenders. Options depend on your purchase amount, and a down payment may be required. More options may be available upon approval. State notices to consumers: affirm.com/licenses.'}}};this._i18n=new l({[e]:t})}catch(e){e instanceof Error&&n.notify(e)}}))}_initContent(){return o(this,void 0,void 0,(function*(){if(!this._i18n)return;const e=document.createElement("template"),t=this.determineListItemsByLoanTypes(this._loanTypes),{subTitle:n,legalCopy:i}=this.determineTextByLoanTypes(this._loanTypes,this._pricePerTerm,this._priceRange,this._eligible,this._minIneligibleMessageType,this._priceWithoutInterest);e.innerHTML=function(e,t,n,i){const a=e.translate("modal.title"),s=e.translate("modal.close"),o=e.translate("modal.new_window"),r=pe(e);return`\n \n \n \n `}(this._i18n,n,i,t),this.rootContainer.appendChild(e.content.cloneNode(!0))}))}}const ge=e=>{const t=999999,n=document.createElement("div"),i=document.createElement("div");if(n.setAttribute("id","shopify-payment-terms-cover"),Object.assign(n.style,{position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:t,background:"rgba(0,0,0,.3)"}),Object.assign(i.style,{position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:t,background:"white",height:"max-content",width:"432px",maxWidth:"95%",maxHeight:"95%",margin:"auto",borderRadius:"7px",padding:"32px",boxSizing:"border-box",overflow:"auto",transition:"max-height ease-in 300ms"}),window.innerWidth<448&&Object.assign(i.style,{borderRadius:"0px",height:"auto",width:"auto",maxHeight:"100%",maxWidth:"100%"}),i.appendChild(e),i.addEventListener(c,(e=>{if(""===e.detail.height)return i.style.maxHeight="95%",void(i.style.overflow="auto");i.style.maxHeight=e.detail.height,i.style.overflow=e.detail.lockScroll?"hidden":"auto"})),"animate"in i){const e=[{opacity:0},{opacity:1}],t=[{transform:"translateY(-15%)",opacity:0},{transform:"translateY(0)",opacity:1}];i.animate(t,{fill:"forwards",duration:150}),n.animate(e,{fill:"forwards",duration:150})}n.appendChild(i),document.body.appendChild(n),document.body.dataset.paymentTermsInitialStyles=JSON.stringify({overflow:document.body.style.overflow}),document.body.style.overflow="hidden",n.addEventListener("click",(t=>{t.target===n&&e.handleClose()}))},ve=()=>{const e=document.querySelector("#shopify-payment-terms-cover");if(e&&(document.body.removeChild(e),document.body.dataset.paymentTermsInitialStyles)){const e=JSON.parse(document.body.dataset.paymentTermsInitialStyles);document.body.style.overflow=e.overflow,document.body.style.position=e.position,delete document.body.dataset.initialStyles}};class Ce extends p{constructor({elementName:e,analyticsTraceId:t,flow:n="",flowVersion:i="unspecified",shopId:a,checkoutVersion:s}){super({elementName:e,analyticsTraceId:t,flow:n,flowVersion:i,shopId:a,checkoutVersion:s}),this._modalActionTracker={},this._bannerImpressionTracked={},this._prequalPopupPageImpressionTracked={},this._bannerPrequalInteractionTracked=!1,this._invalidBannerMetadataTracked=!1}trackModalOpened(t,n,i,a,s,r,l){return o(this,void 0,void 0,(function*(){let o;if(o=t===e.Cart?`${t}-open`:`${n}-open`,this._modalActionTracker[o])return;this._modalActionTracker[o]=!0;const c=yield h("uniqToken","visitToken","microSessionId","microSessionCount","shopId","currency"),p=Object.assign(Object.assign({},c),{origin:t,modalToken:n,eligibleSpiPlanType:i,price:r,cartPermalink:l,spiPlanDetails:a,variantId:s,shopJsVersion:m});d({schemaId:u.InstallmentsModalOpened,payload:p},c,(()=>{this._modalActionTracker[o]=!1}))}))}trackModalAction(e,t,n){return o(this,void 0,void 0,(function*(){const i=`${e}-${t}`;if(this._modalActionTracker[i])return;this._modalActionTracker[i]=!0;const a=yield h("uniqToken","visitToken","microSessionId","microSessionCount","shopId"),s=Object.assign(Object.assign({},a),{modalToken:e,action:t,cartPermalink:n,shopJsVersion:m});d({schemaId:u.InstallmentsModalUserAction,payload:s},a,(()=>{this._modalActionTracker[i]=!1}))}))}trackInstallmentsBannerImpression(e,t,n,i,a,s,r){return o(this,void 0,void 0,(function*(){const o=r?String(r):"cart";if(this._bannerImpressionTracked[o])return;this._bannerImpressionTracked[o]=!0;const l=yield h("uniqToken","visitToken","shopId","microSessionId","contentLanguage","currency"),c=Object.assign(Object.assign({},l),{origin:e,bannerContent:t,eligible:n,bannerTemplateCodeSignature:i,price:s,shopJsVersion:m,hasPrequalLink:a,analyticsTraceId:this.analyticsTraceId||""});d({schemaId:u.InstallmentsBannerImpression,payload:c},l,(()=>{this._bannerImpressionTracked[o]=!1}))}))}trackInstallmentsPrequalPopupPageImpression(e,t){return o(this,void 0,void 0,(function*(){if(this._prequalPopupPageImpressionTracked[t])return;this._prequalPopupPageImpressionTracked[t]=!0;const n={analyticsTraceId:this.analyticsTraceId,sellerId:e,pageType:t};d({schemaId:u.InstallmentsPrequalPopupPageImpression,payload:n},void 0,(()=>{this._prequalPopupPageImpressionTracked[t]=!1}))}))}trackInvalidInstallmentBannerMetadata(e,t){return o(this,void 0,void 0,(function*(){if(this._invalidBannerMetadataTracked)return;this._invalidBannerMetadataTracked=!0;const n=yield h("uniqToken","visitToken","microSessionId","microSessionCount","shopId"),i=Object.assign(Object.assign({},n),{origin:e,metadata:t,shopJsVersion:m});d({schemaId:u.InstallmentsInvalidMetadata,payload:i},n,(()=>{this._invalidBannerMetadataTracked=!1}))}))}trackInstallmentsBannerPrequalInteraction(e,t,n,i,a){return o(this,void 0,void 0,(function*(){if(this._bannerPrequalInteractionTracked)return;this._bannerPrequalInteractionTracked=!0;const s=yield h("uniqToken","visitToken","shopId","microSessionId","contentLanguage","currency"),o=Object.assign(Object.assign({},s),{origin:e,bannerContent:t,eligible:n,price:i,shopJsVersion:m,prequalLinkClicked:a,analyticsTraceId:this.analyticsTraceId});d({schemaId:u.InstallmentsBannerPrequalInteraction,payload:o},s,(()=>{this._bannerPrequalInteractionTracked=!1}))}))}}class we extends HTMLElement{static get observedAttributes(){return["variant-id","shopify-meta"]}constructor(){super(),this._minPrice="$50",this._maxPrice="$3000",this._open=!1,this._eligible=!1,this._numberOfPaymentTerms=4,this._hasChangeEventListener=!1,this._loanTypes=[],this._metaType=e.Product,this._backgroundColor="",this._didMount=!1,this._i18n=null,this.getContent=e=>{if(!this._i18n)return"";const t=X(this._backgroundColor);if(!this._loanTypes.length)return this.getIneligibleContent();if(this._loanTypes.includes(a.SplitPay))return this._i18n.translate("banner.split_pay_eligible",{price:e||"",shopPayLogo:t});return this._loanTypes.includes(a.Interest)?this._i18n.translate("banner.interest_only_eligible",{shopPayLogo:t}):this.getIneligibleContent()},this.getIneligibleContent=()=>{if(!this._i18n)return"";const e=X(this._backgroundColor);return this._i18n.translate("banner.non_eligible_min",{shopPayLogo:e,minPrice:this._minPrice})},this.updateVariant=e=>{var t;const n=null===(t=this._variants)||void 0===t?void 0:t.find((t=>Number(t.id)===e));return this._eligible=Boolean(null==n?void 0:n.eligible),this._loanTypes=(null==n?void 0:n.available_loan_types)||[],this.updateBannerPrice(null==n?void 0:n.price),(null==n?void 0:n.price)||""},this.calculatePricePerTerm=(e,t)=>{const n=t.apr/1200,i=t.installments_count;if(0===n)return ae(e/i);return ae(e*n*Math.pow(1+n,i)/(Math.pow(1+n,i)-1))},this.updateBannerPrice=e=>{var t;let n;n=this._eligible?this.getContent(e):this.getIneligibleContent();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("#shopify-installments-content");i&&(i.innerHTML=n)},this._monorailTracker=new Ce({elementName:"shop-pay-banner"}),this._modalMonorailTracker=new Ce({elementName:"shopify-installments-modal"}),customElements.get("shopify-installments-modal")||customElements.define("shopify-installments-modal",be),customElements.get("shop-pay-logo")||customElements.define("shop-pay-logo",_),this.attachShadow({mode:"open"}).innerHTML=G}initTranslations(){return o(this,void 0,void 0,(function*(){if(!this._i18n)try{const e=l.getDefaultLanguage(),t={affirm:"Affirm",shopPay:"Shop Pay",banner:{learn_more:"Learn more",view_sample_plans:"View sample plans",prequal:"Check your purchasing power",split_pay_eligible:"Pay in 4 interest-free installments of {price} with {shopPayLogo}",split_pay_eligible_2:"Pay in 2 interest-free installments of {price} with {shopPayLogo}",split_pay_eligible_30:"Pay {price} within 30 days interest-free with {shopPayLogo}",interest_only_eligible:"Split your purchase into monthly installments with {shopPayLogo}",dynamic_interest_only_eligible:"From {price}/mo with {shopPayLogo}",pay_in_4_or_as_low_as_eligible:"4 interest-free installments, or from {price}/mo with {shopPayLogo}",zero_interest_eligible:"From {price}/mo or 0% APR with {shopPayLogo}",zero_interest_eligible_zero_apr:"From {price}/mo at 0% APR with {shopPayLogo}",non_eligible_min:"Pay in 4 interest-free installments for orders over {minPrice} with {shopPayLogo}",non_eligible_min_over_time:"Pay over time for orders over {minPrice} with {shopPayLogo}",non_eligible_min_over_time_30:"Pay within 30 days interest-free for orders over {minPrice} with {shopPayLogo}",non_eligible_monthly_payments_min:"Split your purchase into monthly installments for orders over {minPrice} with {shopPayLogo}",non_eligible_max:"Split your purchase into installments for orders up to {maxPrice} with {shopPayLogo}",prequal_contents:{not_prequalified_see_plans:"Check your purchasing power",prequalified_see_plans:"See plans",purchasing_power_a:"Your purchasing power is ",purchasing_power_b:"Spend any amount up to "}},modal:{title:"Get it now, pay later",subtitle:{interest_and_split_pay:'Choose your payment schedule at checkout – starting at 4 interest-free payments of {splitPayLoanRepayment} every 2 weeks.',interest_only:"Choose your payment schedule at checkout to split your purchase into monthly installments.",split_pay_only:'Select installments at checkout to split your purchase into 4 interest-free payments of {splitPayLoanRepayment} every 2 weeks.',split_pay_only_2:'Select installments at checkout to split your purchase into 2 interest-free payments of {splitPayLoanRepayment} every 15 days.',split_pay_only_30:"Select installments at checkout to pay for your purchase of {price} interest-free within 30 days.",ineligible_min:"For orders over {minPrice}, select installments at checkout to split your purchase into 4 interest-free payments.",ineligible_min_over_time:"For orders over {minPrice}, select installments at checkout to split your purchase over time.",ineligible_monthly_payments_min:"For orders over {minPrice}, select installments at checkout to split your purchase into monthly payments.",ineligible_max:"For orders up to {maxPrice}, select installments at checkout to split your purchase into multiple payments.",dynamic_pdp:{one:"Sample plan for {priceWithoutInterest} purchase",other:"Sample plans for {priceWithoutInterest} purchase"}},close:"Close",new_window:"Opens in a new window.",partnership:"Installments in partnership with {affirmLogo}",partnership_disclaimer:"Installments in partnership with {affirmLogo}. Translation services are not provided by Affirm. Affirm and its offerings are only supported in English.",split_pay_contents:{interest_fees:"No hidden fees, ever.",interest_credit:"No impact on your credit score to apply.",no_interest_fees:"No fees, ever.",no_interest_credit:"No impact on your credit score to apply."},sample_plan_contents:{continue_to_checkout:"Continue to checkout",unavailable:"Unavailable",check_eligibility:"By continuing, your information will be shared with Affirm.
Checking your qualification won’t affect your credit. ",apr:"APR",interest:"Interest",total:"Total",processing:"Processing your request",processing_time:"This can take up to a minute...",split_pay_frequency:'{pricePerTerm}  every 2 weeks',other_frequency:'{pricePerTerm}  every month',split_pay_number_of_terms:" for {numberOfTerms} weeks",other_number_of_terms:" for {numberOfTerms} months"},prequal_contents:{unavailable:"Unavailable",check:"Check if you qualify"},legal:{ca_residents_notice:"CA Residents: Loans by Affirm Loan Services, LLC are made or arranged pursuant to a California Finance Lender license.",rates_from_apr:'Rates from 0-36% APR. Payment options through Affirm are subject to an eligibility check, may not be available in all states, and are provided by these lending partners: affirm.com/lenders. Options depend on your purchase amount, and a down payment may be required.',interest_and_split_pay:"The estimated payment amount excludes taxes and shipping.",split_pay_only:"The estimated payment amount excludes taxes and shipping. Payment options are offered by Affirm and are subject to an eligibility check and might not be available in all states.",ineligible:"Payment options are offered by Affirm and are subject to an eligibility check and might not be available in all states.",dynamic_pdp:'The estimated payment amount excludes taxes and shipping. Rates range from 0-36% APR. Payment options through Shop Pay Installments are subject to an eligibility check and are provided by these lending partners: affirm.com/lenders. Options depend on your purchase amount, and a down payment may be required. More options may be available upon approval. State notices to consumers: affirm.com/licenses.'}}};this._i18n=new l({[e]:t})}catch(e){e instanceof Error&&n.notify(e)}}))}attributeChangedCallback(){this._didMount&&this.updateBanner()}connectedCallback(){return o(this,void 0,void 0,(function*(){yield this.initTranslations(),this.updateBanner(),this._didMount=!0}))}updateBanner(){try{const t=this.getAttribute("shopify-meta");if(t){const n=JSON.parse(t);this._backgroundColor=re(this.shadowRoot),J(n,this._monorailTracker.trackInvalidInstallmentBannerMetadata.bind(this._monorailTracker))&&(n.type===e.Cart?(this._monorailTracker.trackElementImpression(e.Cart),this._metaType=e.Cart,this.handleCartMeta(n)):(this._monorailTracker.trackElementImpression(e.Product),this._metaType=e.Product,this.handleProductMeta(n))),this.updateLearnMoreButtonAndModal()}}catch(e){e instanceof TypeError&&e.message.match(ne)?console.error(e):n.notify(e,{metadata:{component:this._componentMetadata()}}),this._clearShadowRoot()}}updateLearnMoreButtonAndModal(){return o(this,void 0,void 0,(function*(){var e;if(!this._i18n)return;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".shopify-installments__learn-more"),n=y();if(t){t.innerHTML=this._i18n.translate("banner.learn_more"),this._monorailTracker.trackInstallmentsBannerImpression(this._metaType,f.PayInFour,this._eligible,b.CustomizedByMerchant,!1,void 0,this._currentVariantId);const e=()=>o(this,void 0,void 0,(function*(){if(this._pricePerTerm&&!this._open){this._open=!0,this._modalMonorailTracker.trackElementImpression(this._metaType);const e={minPrice:this._minPrice,maxPrice:this._maxPrice},a=new be(this._pricePerTerm,this._eligible,e,this._loanTypes,n,this._modalMonorailTracker,void 0,i.SplitPay);yield a.connectedCallback();const s=new ie(a.focusLockTarget);a.addEventListener("shopify_modal_close",(()=>{this._open=!1,ve(),s.release(t)})),ge(a),this._instrumentMonorailModalOpenEvent(a,this._metaType),s.lock()}}));this._lastLearnMoreEventListener&&t.removeEventListener("click",this._lastLearnMoreEventListener),this._lastLearnMoreEventListener=e,t.addEventListener("click",e)}}))}handleProductMeta(e){this._variants=e.variants,this._minPrice=e.min_price,this._minPriceNumber=le(this._minPrice),this._maxPrice=e.max_price,this._maxPriceNumber=le(this._maxPrice),this._currentVariantId=Number(this.getAttribute("variant-id")),this._pricePerTerm=this.updateVariant(this._currentVariantId),this._numberOfPaymentTerms=e.number_of_payment_terms;const t=this._getProductForm();if(t){const e=(n=0)=>{if(n>4)return;const i=ce(t);i&&(this._currentVariantId===i?setTimeout((()=>{e(n+1)}),100):(this._pricePerTerm=this.updateVariant(i),this._currentVariantId=i,this.updateLearnMoreButtonAndModal()))};this._hasChangeEventListener||(this._hasChangeEventListener=!0,t.addEventListener("change",(()=>{e()})))}}handleCartMeta(e){const t=se();this._minPrice=e.min_price,this._minPriceNumber=le(this._minPrice),this._maxPrice=e.max_price,this._maxPriceNumber=le(this._maxPrice),this._loanTypes=e.available_loan_types,this._eligible=e.eligible,this._pricePerTerm=e.price,this._numberOfPaymentTerms=e.number_of_payment_terms,this.updateBannerPrice(this._pricePerTerm),t||oe();new MutationObserver((e=>{e.forEach((e=>{if(e.target.nodeType!==Node.ELEMENT_NODE)return;const n=e.target;if((n.matches("[data-cart-subtotal]")||t&&n.matches(t))&&n.textContent){const e=le(n.textContent);if(e){this._eligible=this._priceEligible(e);const t=this._splitCartPrice(e);if(t){const e=ae(t);this._pricePerTerm=e,this.updateBannerPrice(e)}}}}))})).observe(document,{attributes:!0,childList:!0,subtree:!0})}_splitCartPrice(e){if(!isNaN(e))return Math.floor(e/this._numberOfPaymentTerms*100)/100}_priceEligible(e){return null!=this._minPriceNumber&&null!=this._maxPriceNumber&&e>=this._minPriceNumber&&e<=this._maxPriceNumber}_instrumentMonorailModalOpenEvent(e,t){this._modalMonorailTracker.trackModalOpened(t,e.getModalToken(),e.getModalType(),JSON.stringify([]),this._currentVariantId,void 0)}_getProductForm(){var e,t,n;return null===(n=null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.host.parentNode)||void 0===t?void 0:t.host)||void 0===n?void 0:n.closest("form")}_clearShadowRoot(){this.shadowRoot&&(this.shadowRoot.innerHTML="")}_componentMetadata(){return{name:"shop-pay-banner",shopifyMeta:this.getAttribute("shopify-meta"),variantId:this.getAttribute("variant-id")}}}class Pe extends HTMLElement{constructor(e,t,n,i,a,o,r){var l;super(),this._i18n=null,this._samplePlans=[],this._trackContinueToCheckout=!0,this._initialized=!1,this.handleClose=()=>{this._monorailTracker.trackModalAction(this._modalToken,s.Close,this._permalink);const e=new Event("shopify_modal_close");this.dispatchEvent(e)},this.handleEscKey=e=>{"Escape"!==e.key&&"Esc"!==e.key||this.handleClose()},this.handleContinueToCheckout=()=>{this._trackContinueToCheckout&&this._monorailTracker.trackModalAction(this._modalToken,s.ContinueToCheckout,this._permalink)},this._modalToken=e,this._monorailTracker=t,this._trackContinueToCheckout=null===(l=null==o?void 0:o.available)||void 0===l||l,this._installmentPlans=n,this._priceWithoutInterest=i,this._variantInfo=o,this._cart=r,this._metaType=a}get focusLockTarget(){return this.querySelector("#shopify-payment-terms-modal")}get rootContainer(){return this}connectedCallback(){return o(this,void 0,void 0,(function*(){this._initialized||(yield this._initTranslations(),yield this._initContent(),this._closeButtons=this.querySelectorAll(".btn__close"),this._closeButtons&&0!==this._closeButtons.length&&(this._closeButtons.forEach((e=>e.addEventListener("click",this.handleClose))),this._closeButtons[0].focus(),this._continueToCheckoutButton&&this._continueToCheckoutButton.addEventListener("click",this.handleContinueToCheckout),window.addEventListener("keydown",this.handleEscKey),this._initialized=!0))}))}disconnectedCallback(){this._closeButtons&&(this._closeButtons.forEach((e=>e.removeEventListener("click",this.handleClose))),this._continueToCheckoutButton&&this._continueToCheckoutButton.removeEventListener("click",this.handleContinueToCheckout),window.removeEventListener("keydown",this.handleEscKey))}getModalSamplePlans(){return this._samplePlans}getPermalink(){return this._permalink}getModalToken(){return this._modalToken}getModalType(){var e,t,n,i;if(null===(e=this._samplePlans)||void 0===e?void 0:e.some((e=>0===e.apr&&e.loanType===a.Interest))){return(null===(t=this._samplePlans)||void 0===t?void 0:t.every((e=>0===e.apr)))?r.ZeroInterestOnly:r.ZeroInterest}return(null===(n=this._samplePlans)||void 0===n?void 0:n.some((e=>e.loanType===a.SplitPay)))&&(null===(i=this._samplePlans)||void 0===i?void 0:i.some((e=>e.loanType===a.Interest)))?r.Adaptive:r.InterestOnly}getButtonText(){var e;return this._i18n?!1===(null===(e=this._variantInfo)||void 0===e?void 0:e.available)?this._i18n.translate("modal.sample_plan_contents.unavailable"):this._i18n.translate("modal.sample_plan_contents.continue_to_checkout"):""}_initTranslations(){return o(this,void 0,void 0,(function*(){if(!this._i18n)try{const e=l.getDefaultLanguage(),t={affirm:"Affirm",shopPay:"Shop Pay",banner:{learn_more:"Learn more",view_sample_plans:"View sample plans",prequal:"Check your purchasing power",split_pay_eligible:"Pay in 4 interest-free installments of {price} with {shopPayLogo}",split_pay_eligible_2:"Pay in 2 interest-free installments of {price} with {shopPayLogo}",split_pay_eligible_30:"Pay {price} within 30 days interest-free with {shopPayLogo}",interest_only_eligible:"Split your purchase into monthly installments with {shopPayLogo}",dynamic_interest_only_eligible:"From {price}/mo with {shopPayLogo}",pay_in_4_or_as_low_as_eligible:"4 interest-free installments, or from {price}/mo with {shopPayLogo}",zero_interest_eligible:"From {price}/mo or 0% APR with {shopPayLogo}",zero_interest_eligible_zero_apr:"From {price}/mo at 0% APR with {shopPayLogo}",non_eligible_min:"Pay in 4 interest-free installments for orders over {minPrice} with {shopPayLogo}",non_eligible_min_over_time:"Pay over time for orders over {minPrice} with {shopPayLogo}",non_eligible_min_over_time_30:"Pay within 30 days interest-free for orders over {minPrice} with {shopPayLogo}",non_eligible_monthly_payments_min:"Split your purchase into monthly installments for orders over {minPrice} with {shopPayLogo}",non_eligible_max:"Split your purchase into installments for orders up to {maxPrice} with {shopPayLogo}",prequal_contents:{not_prequalified_see_plans:"Check your purchasing power",prequalified_see_plans:"See plans",purchasing_power_a:"Your purchasing power is ",purchasing_power_b:"Spend any amount up to "}},modal:{title:"Get it now, pay later",subtitle:{interest_and_split_pay:'Choose your payment schedule at checkout – starting at 4 interest-free payments of {splitPayLoanRepayment} every 2 weeks.',interest_only:"Choose your payment schedule at checkout to split your purchase into monthly installments.",split_pay_only:'Select installments at checkout to split your purchase into 4 interest-free payments of {splitPayLoanRepayment} every 2 weeks.',split_pay_only_2:'Select installments at checkout to split your purchase into 2 interest-free payments of {splitPayLoanRepayment} every 15 days.',split_pay_only_30:"Select installments at checkout to pay for your purchase of {price} interest-free within 30 days.",ineligible_min:"For orders over {minPrice}, select installments at checkout to split your purchase into 4 interest-free payments.",ineligible_min_over_time:"For orders over {minPrice}, select installments at checkout to split your purchase over time.",ineligible_monthly_payments_min:"For orders over {minPrice}, select installments at checkout to split your purchase into monthly payments.",ineligible_max:"For orders up to {maxPrice}, select installments at checkout to split your purchase into multiple payments.",dynamic_pdp:{one:"Sample plan for {priceWithoutInterest} purchase",other:"Sample plans for {priceWithoutInterest} purchase"}},close:"Close",new_window:"Opens in a new window.",partnership:"Installments in partnership with {affirmLogo}",partnership_disclaimer:"Installments in partnership with {affirmLogo}. Translation services are not provided by Affirm. Affirm and its offerings are only supported in English.",split_pay_contents:{interest_fees:"No hidden fees, ever.",interest_credit:"No impact on your credit score to apply.",no_interest_fees:"No fees, ever.",no_interest_credit:"No impact on your credit score to apply."},sample_plan_contents:{continue_to_checkout:"Continue to checkout",unavailable:"Unavailable",check_eligibility:"By continuing, your information will be shared with Affirm.
Checking your qualification won’t affect your credit. ",apr:"APR",interest:"Interest",total:"Total",processing:"Processing your request",processing_time:"This can take up to a minute...",split_pay_frequency:'{pricePerTerm}  every 2 weeks',other_frequency:'{pricePerTerm}  every month',split_pay_number_of_terms:" for {numberOfTerms} weeks",other_number_of_terms:" for {numberOfTerms} months"},prequal_contents:{unavailable:"Unavailable",check:"Check if you qualify"},legal:{ca_residents_notice:"CA Residents: Loans by Affirm Loan Services, LLC are made or arranged pursuant to a California Finance Lender license.",rates_from_apr:'Rates from 0-36% APR. Payment options through Affirm are subject to an eligibility check, may not be available in all states, and are provided by these lending partners: affirm.com/lenders. Options depend on your purchase amount, and a down payment may be required.',interest_and_split_pay:"The estimated payment amount excludes taxes and shipping.",split_pay_only:"The estimated payment amount excludes taxes and shipping. Payment options are offered by Affirm and are subject to an eligibility check and might not be available in all states.",ineligible:"Payment options are offered by Affirm and are subject to an eligibility check and might not be available in all states.",dynamic_pdp:'The estimated payment amount excludes taxes and shipping. Rates range from 0-36% APR. Payment options through Shop Pay Installments are subject to an eligibility check and are provided by these lending partners: affirm.com/lenders. Options depend on your purchase amount, and a down payment may be required. More options may be available upon approval. State notices to consumers: affirm.com/licenses.'}}};this._i18n=new l({[e]:t})}catch(e){e instanceof Error&&n.notify(e)}}))}_initContent(){return o(this,void 0,void 0,(function*(){if(!this._i18n)return;const t=document.createElement("template");this._samplePlans=me(this._installmentPlans,this._priceWithoutInterest);const{subTitle:n,legalCopy:i}=he(this._i18n,this._samplePlans.length,this._priceWithoutInterest);t.innerHTML=de(this._i18n,n,i,this._samplePlans),this.appendChild(t.content.cloneNode(!0));const a=this.getElementsByClassName("navigation-buttons")[0];if(this._metaType===e.Checkout){const e=this.getElementsByClassName("check_eligibility")[0];return a.classList.add("hidden-navigation-buttons"),void e.classList.add("hidden-navigation-buttons")}const s=this.getButtonText();a.innerHTML=ue(window.location.origin,this._modalToken,s,this._variantInfo,this._cart),this._continueToCheckoutButton=a.querySelector("shop-pay-button"),this._permalink=this._cart?this._cart.token:g({storeUrl:window.location.origin,variants:this._variantInfo?v(this._variantInfo.idQuantityMapping):[],paymentOption:C.ShopPayInstallments,source:"installments_modal",sourceToken:this._modalToken})}))}}var ke,Te,Le,xe,Ie,Se,qe,Me,Ee,Ae,Be;class Fe extends HTMLElement{constructor(e,t,n,i,a,o,r,l,c,p){super(),ke.add(this),this._samplePlans=[],this._authorizeModalOpened=!1,this._nextState=P.AuthorizeLoaded,this._i18n=null,this._initialized=!1,this.handleClose=()=>{this._monorailTracker.trackModalAction(this._modalToken,s.Close,this._permalink);const e=new Event("shopify_modal_close");this.dispatchEvent(e);const t=document.querySelector(".prequal");t&&document.body.removeChild(t),this._closePrequalBuyerFormOverlay()},this.handleEscKey=e=>{"Escape"!==e.key&&"Esc"!==e.key||!this._authorizeModalOpened?"Escape"!==e.key&&"Esc"!==e.key||this.handleClose():this._closeAuthorizeModal()},this.handleOverlayClose=()=>{var e;null===(e=document.querySelector("installments-prequal-overlay-modal"))||void 0===e||e.remove()},this.handleBuyerOnboardingSuccess=()=>{this.handleOverlayClose(),this._openFeatureIframe()},this.handlePrequalFlowSideEffect=e=>{this._prequalSideEffectEventReceived=!0;e.detail.shopPayInstallmentsOnboarded?this._nextState=P.ResultsPageLoaded:this._nextState=P.BuyerFormOverlayLoaded,this._completedEventReceived&&(this.removeCheckIfYouQualifyButtonLoading(),this.handleLoginCompleted())},this.handleLoginCompleted=()=>{if(this._completedEventReceived=!0,this._prequalSideEffectEventReceived)switch(this._nextState){case P.ResultsPageLoaded:this._openFeatureIframe();break;case P.BuyerFormOverlayLoaded:this._openPrequalBuyerFormOverlay()}else this.addCheckIfYouQualifyButtonLoading()},this.handleLoginModalOpened=()=>{this.removeCheckIfYouQualifyButtonLoading()},this.addCheckIfYouQualifyButtonLoading=()=>{this._contentStatusIndicator=k(T.Branded),this._contentStatusIndicator.classList.add("shop-status-indicator-loading"),this._navigationButtons.querySelector("shop-pay-button").classList.add("prequal-hidden-state"),this._navigationButtons.appendChild(this._contentStatusIndicator),this._contentStatusIndicator.connectedCallback(),this._contentStatusIndicator.setStatus({status:"loading",message:""})},this.removeCheckIfYouQualifyButtonLoading=()=>{this._contentStatusIndicator&&(this._navigationButtons.querySelector("shop-pay-button").classList.remove("prequal-hidden-state"),this._navigationButtons.removeChild(this._contentStatusIndicator))},this._modalToken=e,this._monorailTracker=t,this._analyticsTraceId=p||this.getAttribute(L)||x(),this._variantInfo=l,this._cart=c,this._loanTypes=n,this._eligible=i,this._productAmount=le(o),this._sellerId=r,this._installmentsPlans=a,this._priceWithoutInterest=o,this.attachShadow({mode:"open",delegatesFocus:!0})}get focusLockTarget(){return this.rootContainer.querySelector("#shopify-payment-terms-modal")}get rootContainer(){return this.shadowRoot}destroyIframe(){var e;null===(e=this._iframeMessageListener)||void 0===e||e.destroy()}connectedCallback(){return o(this,void 0,void 0,(function*(){this._initialized||(yield this._initTranslations(),yield this._initContent(),I(this,ke,"m",Le).call(this),window.addEventListener("keydown",this.handleEscKey),this.addOverlayEventListeners())}))}addOverlayEventListeners(){window.addEventListener("overlayClose",this.handleOverlayClose),window.addEventListener("buyerOnboardingSuccess",this.handleBuyerOnboardingSuccess),window.addEventListener("closeOverlayAndModal",(()=>{this.handleOverlayClose(),this.handleClose()})),this._initialized=!0}disconnectedCallback(){this._closeAuthorizeModal(),this._closeButtons&&(this._closeButtons.forEach((e=>e.removeEventListener("click",this.handleClose))),window.removeEventListener("keydown",this.handleEscKey),this.destroyIframe())}handlePostMessage(e){var t;switch(e.type){case"prequal_ready":null===(t=this._iframeMessenger)||void 0===t||t.postMessage({type:"createprequal",amount:this._productAmount,currency:"USD",sellerId:Number(this._sellerId)});break;case"prequal_success":case"prequal_error":this._showFeatureIframe();break;case"prequal_missing_information":this._showMainContent(),this._openPrequalBuyerFormOverlay();break;case"close":this.handleClose();break;case"continue_to_checkout":this._continueToCheckout();break;case"resize_iframe":this._iframe.style.height=e.height0===e.apr&&e.loanType===a.Interest))){return(null===(n=this._samplePlans)||void 0===n?void 0:n.every((e=>0===e.apr)))?r.ZeroInterestOnly:r.ZeroInterest}return(null===(i=this._samplePlans)||void 0===i?void 0:i.some((e=>e.loanType===a.SplitPay)))&&(null===(s=this._samplePlans)||void 0===s?void 0:s.some((e=>e.loanType===a.Interest)))?r.Adaptive:r.InterestOnly}_openFeatureIframe(){if(this._iframe)return;this._contentStatusIndicator=k(T.Large);const e=this._contentProcessingWrapper.querySelector(".shop-modal-content-processing-loading-container");null==e||e.insertBefore(this._contentStatusIndicator,e.firstChild),this._contentStatusIndicator.setStatus({status:"loading",message:""});const t=(e=>{const t=w.replace("https://","");return`${w}/pay/installments/prequalifications/authorize?shopify_domain=${window.location.hostname}&pay_domain=${t}&analytics_trace_id=${e}&redirect_source=${window.location.origin}`})(this._analyticsTraceId);this._iframe=document.createElement("iframe"),this._iframe.style.border="none",this._iframe.src=t,this._featureIframeWrapper.appendChild(this._iframe),this._showLoadingState(),this._iframeMessageListener||(this._iframeMessageListener=this.createListener(new S(this._iframe))),this._iframeMessenger||(this._iframeMessenger=new q(this._iframe))}createListener(e){var t;const n=(null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0;return new M(e,[w,E,window.location.origin],this.handlePostMessage.bind(this),n)}_getSellerIdInNumber(){return this._sellerId?Number.parseInt(this._sellerId,10):void 0}_continueToCheckout(){var e;const t=this.rootContainer.querySelector("shop-pay-button").shadowRoot,n=null==t?void 0:t.querySelector("shop-pay-button-base"),i=null===(e=null==n?void 0:n.shadowRoot)||void 0===e?void 0:e.querySelector("#shop-pay-button-link");null==i||i.dispatchEvent(new MouseEvent("click")),null==n||n.dispatchEvent(new Event("click")),this._monorailTracker.trackInstallmentsPrequalPopupPageImpression(this._getSellerIdInNumber(),P.ContinueToCheckoutClicked)}_openPrequalBuyerFormOverlay(){if(document.querySelector(".prequal-buyer-form-overlay"))return;const e=document.createElement("installments-prequal-overlay-modal");e.classList.add("prequal-buyer-form-overlay"),document.body.appendChild(e),this._monorailTracker.trackInstallmentsPrequalPopupPageImpression(this._getSellerIdInNumber(),P.BuyerFormOverlayLoaded)}_closePrequalBuyerFormOverlay(){const e=document.querySelector(".prequal-buyer-form-overlay");e&&document.body.removeChild(e)}_openAuthorizeModal(){const e=document.querySelector(".prequal");(null==e?void 0:e.requestShow)||n.notify(new Error(`shopLoginButton.requestShow is not defined: ${e}`)),null==e||e.requestShow(""),this._authorizeModalOpened=!0,this._monorailTracker.trackInstallmentsPrequalPopupPageImpression(this._getSellerIdInNumber(),P.AuthorizeLoaded)}_closeAuthorizeModal(){this._authorizeModalOpened=!1}_showLoadingState(){I(this,ke,"m",Te).call(this,"400px"),this._contentProcessingWrapper.classList.remove("prequal-hidden-state"),this._featureIframeWrapper.classList.add("prequal-hidden-state"),this._contentModalWrapper.classList.add("opaque-hidden"),this._monorailTracker.trackInstallmentsPrequalPopupPageImpression(this._getSellerIdInNumber(),P.ResultsPageLoading)}_showFeatureIframe(){var e,t,n,i;I(this,ke,"m",Te).call(this,""),this._contentModalWrapper.classList.add("prequal-hidden-state"),this._contentProcessingWrapper.classList.add("prequal-hidden-state"),this._featureIframeWrapper.classList.remove("prequal-hidden-state"),this._continueToCheckoutContainer.innerHTML=(e=window.location.origin,t=this._modalToken,n=this._variantInfo,i=this._cart,`\n \n`)}_showMainContent(){this._contentModalWrapper.classList.remove("opaque-hidden"),this._contentProcessingWrapper.classList.add("prequal-hidden-state"),this._featureIframeWrapper.classList.add("prequal-hidden-state")}getButtonText(e){return this._i18n?!1===(null==e?void 0:e.available)?this._i18n.translate("modal.prequal_contents.unavailable"):this._i18n.translate("modal.prequal_contents.check"):""}_initTranslations(){return o(this,void 0,void 0,(function*(){if(!this._i18n)try{const e=l.getDefaultLanguage(),t={affirm:"Affirm",shopPay:"Shop Pay",banner:{learn_more:"Learn more",view_sample_plans:"View sample plans",prequal:"Check your purchasing power",split_pay_eligible:"Pay in 4 interest-free installments of {price} with {shopPayLogo}",split_pay_eligible_2:"Pay in 2 interest-free installments of {price} with {shopPayLogo}",split_pay_eligible_30:"Pay {price} within 30 days interest-free with {shopPayLogo}",interest_only_eligible:"Split your purchase into monthly installments with {shopPayLogo}",dynamic_interest_only_eligible:"From {price}/mo with {shopPayLogo}",pay_in_4_or_as_low_as_eligible:"4 interest-free installments, or from {price}/mo with {shopPayLogo}",zero_interest_eligible:"From {price}/mo or 0% APR with {shopPayLogo}",zero_interest_eligible_zero_apr:"From {price}/mo at 0% APR with {shopPayLogo}",non_eligible_min:"Pay in 4 interest-free installments for orders over {minPrice} with {shopPayLogo}",non_eligible_min_over_time:"Pay over time for orders over {minPrice} with {shopPayLogo}",non_eligible_min_over_time_30:"Pay within 30 days interest-free for orders over {minPrice} with {shopPayLogo}",non_eligible_monthly_payments_min:"Split your purchase into monthly installments for orders over {minPrice} with {shopPayLogo}",non_eligible_max:"Split your purchase into installments for orders up to {maxPrice} with {shopPayLogo}",prequal_contents:{not_prequalified_see_plans:"Check your purchasing power",prequalified_see_plans:"See plans",purchasing_power_a:"Your purchasing power is ",purchasing_power_b:"Spend any amount up to "}},modal:{title:"Get it now, pay later",subtitle:{interest_and_split_pay:'Choose your payment schedule at checkout – starting at 4 interest-free payments of {splitPayLoanRepayment} every 2 weeks.',interest_only:"Choose your payment schedule at checkout to split your purchase into monthly installments.",split_pay_only:'Select installments at checkout to split your purchase into 4 interest-free payments of {splitPayLoanRepayment} every 2 weeks.',split_pay_only_2:'Select installments at checkout to split your purchase into 2 interest-free payments of {splitPayLoanRepayment} every 15 days.',split_pay_only_30:"Select installments at checkout to pay for your purchase of {price} interest-free within 30 days.",ineligible_min:"For orders over {minPrice}, select installments at checkout to split your purchase into 4 interest-free payments.",ineligible_min_over_time:"For orders over {minPrice}, select installments at checkout to split your purchase over time.",ineligible_monthly_payments_min:"For orders over {minPrice}, select installments at checkout to split your purchase into monthly payments.",ineligible_max:"For orders up to {maxPrice}, select installments at checkout to split your purchase into multiple payments.",dynamic_pdp:{one:"Sample plan for {priceWithoutInterest} purchase",other:"Sample plans for {priceWithoutInterest} purchase"}},close:"Close",new_window:"Opens in a new window.",partnership:"Installments in partnership with {affirmLogo}",partnership_disclaimer:"Installments in partnership with {affirmLogo}. Translation services are not provided by Affirm. Affirm and its offerings are only supported in English.",split_pay_contents:{interest_fees:"No hidden fees, ever.",interest_credit:"No impact on your credit score to apply.",no_interest_fees:"No fees, ever.",no_interest_credit:"No impact on your credit score to apply."},sample_plan_contents:{continue_to_checkout:"Continue to checkout",unavailable:"Unavailable",check_eligibility:"By continuing, your information will be shared with Affirm.
Checking your qualification won’t affect your credit. ",apr:"APR",interest:"Interest",total:"Total",processing:"Processing your request",processing_time:"This can take up to a minute...",split_pay_frequency:'{pricePerTerm}  every 2 weeks',other_frequency:'{pricePerTerm}  every month',split_pay_number_of_terms:" for {numberOfTerms} weeks",other_number_of_terms:" for {numberOfTerms} months"},prequal_contents:{unavailable:"Unavailable",check:"Check if you qualify"},legal:{ca_residents_notice:"CA Residents: Loans by Affirm Loan Services, LLC are made or arranged pursuant to a California Finance Lender license.",rates_from_apr:'Rates from 0-36% APR. Payment options through Affirm are subject to an eligibility check, may not be available in all states, and are provided by these lending partners: affirm.com/lenders. Options depend on your purchase amount, and a down payment may be required.',interest_and_split_pay:"The estimated payment amount excludes taxes and shipping.",split_pay_only:"The estimated payment amount excludes taxes and shipping. Payment options are offered by Affirm and are subject to an eligibility check and might not be available in all states.",ineligible:"Payment options are offered by Affirm and are subject to an eligibility check and might not be available in all states.",dynamic_pdp:'The estimated payment amount excludes taxes and shipping. Rates range from 0-36% APR. Payment options through Shop Pay Installments are subject to an eligibility check and are provided by these lending partners: affirm.com/lenders. Options depend on your purchase amount, and a down payment may be required. More options may be available upon approval. State notices to consumers: affirm.com/licenses.'}}};this._i18n=new l({[e]:t})}catch(e){e instanceof Error&&n.notify(e)}}))}_initContent(){return o(this,void 0,void 0,(function*(){if(!this._i18n)return;const e=document.createElement("template");this._samplePlans=me(this._installmentsPlans,this._priceWithoutInterest);const{subTitle:t,legalCopy:n}=he(this._i18n,this._samplePlans.length,this._priceWithoutInterest);e.innerHTML=de(this._i18n,t,n,this._samplePlans),this.rootContainer.innerHTML="",this.rootContainer.appendChild(e.content.cloneNode(!0)),this._contentProcessingWrapper=this.rootContainer.querySelector(".shop-modal-content-processing"),this._contentModalWrapper=this.rootContainer.querySelector(".modal-wrapper"),this._featureIframeWrapper=this.rootContainer.querySelector(".shop-modal-feature-iframe-wrapper"),this._navigationButtons=this.rootContainer.querySelectorAll(".navigation-buttons")[0],this._continueToCheckoutContainer=this.rootContainer.querySelectorAll(".continue-to-checkout-button")[0],this._permalink=this._cart?this._cart.token:g({storeUrl:window.location.origin,variants:this._variantInfo?v(this._variantInfo.idQuantityMapping):[],paymentOption:C.ShopPayInstallments,source:"installments_modal",sourceToken:this._modalToken})}))}}ke=new WeakSet,Te=function(e){const t=new CustomEvent(c,{detail:{height:e,lockScroll:""!==e},bubbles:!0});this.dispatchEvent(t)},Le=function(){const e=this.getButtonText(this._variantInfo);this._navigationButtons.innerHTML=ue("",this._modalToken,e,this._variantInfo,this._cart);const t=this._navigationButtons.querySelector("shop-pay-button"),i=t.shadowRoot,a=null==i?void 0:i.querySelector("#shop-pay-button-link");null==a||a.setAttribute("href","#");const s=document.createElement("shop-login-button");s.setAttribute("action",A.Prequal),s.setAttribute("client-id",""),s.setAttribute("version","2"),s.setAttribute("analytics-context",B.Prequal),s.setAttribute("analytics-trace-id",this._analyticsTraceId),s.setAttribute("hide-button","true"),s.classList.add("prequal"),s.setAttribute("anchor-to","shop-pay-button"),document.body.appendChild(s),t.addEventListener("click",(()=>{switch(this.addCheckIfYouQualifyButtonLoading(),this._nextState){case P.AuthorizeLoaded:const e=document.querySelector(".prequal");(null==e?void 0:e.requestShow)||n.notify(new Error("checkIfYouQualifyButton clicked: shopLoginButton.requestShow is not defined")),this._openAuthorizeModal();break;case P.BuyerFormOverlayLoaded:this.removeCheckIfYouQualifyButtonLoading(),this._openPrequalBuyerFormOverlay();break;case P.ResultsPageLoaded:this.removeCheckIfYouQualifyButtonLoading(),this._openFeatureIframe()}})),s.addEventListener("completed",this.handleLoginCompleted),s.addEventListener("prequal_flow_side_effect",this.handlePrequalFlowSideEffect),s.addEventListener("modalopened",this.handleLoginModalOpened),this._closeButtons=this.rootContainer.querySelectorAll(".btn__close"),this._closeButtons&&0!==this._closeButtons.length&&(this._closeButtons.forEach((e=>e.addEventListener("click",this.handleClose))),this._closeButtons[0].focus())};class Oe extends HTMLElement{static get observedAttributes(){return["variant-id","shopify-meta"]}constructor(){super(),xe.add(this),this._minPrice="$50",this._maxPrice="$3000",this._open=!1,this._eligible=!1,this._numberOfPaymentTerms=4,this._hasChangeEventListener=!1,this._loanTypes=[],this._lastLearnMoreEventListener=new WeakMap,this._metaType=e.Product,this._backgroundColor="",this._didMount=!1,this._variantAvailable=!0,this._i18n=null,this.getContent=t=>{if(!this._i18n)return"";if(this._metaType===e.Checkout)return"";const n=X(this._backgroundColor);if(!this._loanTypes.length)return this.getIneligibleContent();if(this._financingTermForBanner&&this._hasZeroInterestLoanType()){return 0===this._financingTermForBanner.apr?this._i18n.translate("banner.zero_interest_eligible_zero_apr",{price:t,shopPayLogo:n}):this._i18n.translate("banner.zero_interest_eligible",{price:t,shopPayLogo:n})}if(this._financingTermForBanner&&this.isInAdaptiveRangeWithoutZeroInterest())return this._i18n.translate("banner.pay_in_4_or_as_low_as_eligible",{price:t,shopPayLogo:n});if(this._loanTypes.includes(a.SplitPay)){let e="banner.split_pay_eligible";return 2===this._numberOfPaymentTerms?e="banner.split_pay_eligible_2":1===this._numberOfPaymentTerms&&(e="banner.split_pay_eligible_30"),this._i18n.translate(e,{price:t,shopPayLogo:n})}return this._loanTypes.includes(a.Interest)?this._i18n.translate("banner.dynamic_interest_only_eligible",{price:t,shopPayLogo:n}):this.getIneligibleContent()},this.getIneligibleContent=()=>{if(!this._i18n)return"";const e=X(this._backgroundColor);let t="banner.non_eligible_min";this._minIneligibleMessageType===i.Monthly?t="banner.non_eligible_monthly_payments_min":2===this._numberOfPaymentTerms?t="banner.non_eligible_min_over_time":1===this._numberOfPaymentTerms&&(t="banner.non_eligible_min_over_time_30");const n=this._i18n.translate(t,{minPrice:this._minPrice,shopPayLogo:e});if(!this._fullPrice)return n;return le(this._fullPrice)>le(this._maxPrice)?this._i18n.translate("banner.non_eligible_max",{maxPrice:this._maxPrice,shopPayLogo:e}):n},this.updatePDPVariant=(e,t)=>{var n;const i=null===(n=this._variants)||void 0===n?void 0:n.find((t=>Number(t.id)===e));if(!i||!i.full_price)return this._eligible=!1,this._loanTypes=[],this.updateBannerPrice(),"";this._eligible=i.eligible,this._loanTypes=this._getAvailableLoanTypes(i.full_price,t),this._variantAvailable=i.available;const s=le(i.full_price),o=this._getFinancingPlanForPrice(s,t);if(!o)return this.updateBannerPrice(i.price_per_term),i.price_per_term;if(this._financingTermForBanner=this._getFinancingTermForBanner(o),this._financingTermForBanner.loan_type===a.SplitPay)return this.updateBannerPrice(i.price_per_term),i.price_per_term;const r=this.calculatePricePerTerm(s,this._financingTermForBanner);return this.updateBannerPrice(r),r},this.calculatePricePerTerm=(e,t)=>{const n=t.apr/1200,i=t.installments_count;if(0===n)return ae(e/i);return ae(e*n*Math.pow(1+n,i)/(Math.pow(1+n,i)-1))},this.updateBannerPrice=t=>{var n,i;let a;if(a=this._eligible&&t?this.getContent(t):this.getIneligibleContent(),this._metaType===e.Checkout){const e=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector("#shopify-installments");null==e||e.classList.add("shopify-installments__inline")}const s=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector("#shopify-installments-content");s&&(s.innerHTML=a)},this._analyticsTraceId=y(),this._monorailTracker=new Ce({elementName:"shop-pay-installments-banner",analyticsTraceId:this._analyticsTraceId}),this._modalMonorailTracker=new Ce({elementName:"shopify-installments-modal",analyticsTraceId:this._analyticsTraceId}),customElements.get("shopify-installments-modal")||customElements.define("shopify-installments-modal",be),customElements.get("shopify-installments-sample-plans-modal")||customElements.define("shopify-installments-sample-plans-modal",Pe),customElements.get("shopify-installments-prequal-modal")||customElements.define("shopify-installments-prequal-modal",Fe),customElements.get("shop-pay-logo")||customElements.define("shop-pay-logo",_),this.attachShadow({mode:"open"}).innerHTML=G}initTranslations(){return o(this,void 0,void 0,(function*(){if(!this._i18n)try{const e=l.getDefaultLanguage(),t={affirm:"Affirm",shopPay:"Shop Pay",banner:{learn_more:"Learn more",view_sample_plans:"View sample plans",prequal:"Check your purchasing power",split_pay_eligible:"Pay in 4 interest-free installments of {price} with {shopPayLogo}",split_pay_eligible_2:"Pay in 2 interest-free installments of {price} with {shopPayLogo}",split_pay_eligible_30:"Pay {price} within 30 days interest-free with {shopPayLogo}",interest_only_eligible:"Split your purchase into monthly installments with {shopPayLogo}",dynamic_interest_only_eligible:"From {price}/mo with {shopPayLogo}",pay_in_4_or_as_low_as_eligible:"4 interest-free installments, or from {price}/mo with {shopPayLogo}",zero_interest_eligible:"From {price}/mo or 0% APR with {shopPayLogo}",zero_interest_eligible_zero_apr:"From {price}/mo at 0% APR with {shopPayLogo}",non_eligible_min:"Pay in 4 interest-free installments for orders over {minPrice} with {shopPayLogo}",non_eligible_min_over_time:"Pay over time for orders over {minPrice} with {shopPayLogo}",non_eligible_min_over_time_30:"Pay within 30 days interest-free for orders over {minPrice} with {shopPayLogo}",non_eligible_monthly_payments_min:"Split your purchase into monthly installments for orders over {minPrice} with {shopPayLogo}",non_eligible_max:"Split your purchase into installments for orders up to {maxPrice} with {shopPayLogo}",prequal_contents:{not_prequalified_see_plans:"Check your purchasing power",prequalified_see_plans:"See plans",purchasing_power_a:"Your purchasing power is ",purchasing_power_b:"Spend any amount up to "}},modal:{title:"Get it now, pay later",subtitle:{interest_and_split_pay:'Choose your payment schedule at checkout – starting at 4 interest-free payments of {splitPayLoanRepayment} every 2 weeks.',interest_only:"Choose your payment schedule at checkout to split your purchase into monthly installments.",split_pay_only:'Select installments at checkout to split your purchase into 4 interest-free payments of {splitPayLoanRepayment} every 2 weeks.',split_pay_only_2:'Select installments at checkout to split your purchase into 2 interest-free payments of {splitPayLoanRepayment} every 15 days.',split_pay_only_30:"Select installments at checkout to pay for your purchase of {price} interest-free within 30 days.",ineligible_min:"For orders over {minPrice}, select installments at checkout to split your purchase into 4 interest-free payments.",ineligible_min_over_time:"For orders over {minPrice}, select installments at checkout to split your purchase over time.",ineligible_monthly_payments_min:"For orders over {minPrice}, select installments at checkout to split your purchase into monthly payments.",ineligible_max:"For orders up to {maxPrice}, select installments at checkout to split your purchase into multiple payments.",dynamic_pdp:{one:"Sample plan for {priceWithoutInterest} purchase",other:"Sample plans for {priceWithoutInterest} purchase"}},close:"Close",new_window:"Opens in a new window.",partnership:"Installments in partnership with {affirmLogo}",partnership_disclaimer:"Installments in partnership with {affirmLogo}. Translation services are not provided by Affirm. Affirm and its offerings are only supported in English.",split_pay_contents:{interest_fees:"No hidden fees, ever.",interest_credit:"No impact on your credit score to apply.",no_interest_fees:"No fees, ever.",no_interest_credit:"No impact on your credit score to apply."},sample_plan_contents:{continue_to_checkout:"Continue to checkout",unavailable:"Unavailable",check_eligibility:"By continuing, your information will be shared with Affirm.
Checking your qualification won’t affect your credit. ",apr:"APR",interest:"Interest",total:"Total",processing:"Processing your request",processing_time:"This can take up to a minute...",split_pay_frequency:'{pricePerTerm}  every 2 weeks',other_frequency:'{pricePerTerm}  every month',split_pay_number_of_terms:" for {numberOfTerms} weeks",other_number_of_terms:" for {numberOfTerms} months"},prequal_contents:{unavailable:"Unavailable",check:"Check if you qualify"},legal:{ca_residents_notice:"CA Residents: Loans by Affirm Loan Services, LLC are made or arranged pursuant to a California Finance Lender license.",rates_from_apr:'Rates from 0-36% APR. Payment options through Affirm are subject to an eligibility check, may not be available in all states, and are provided by these lending partners: affirm.com/lenders. Options depend on your purchase amount, and a down payment may be required.',interest_and_split_pay:"The estimated payment amount excludes taxes and shipping.",split_pay_only:"The estimated payment amount excludes taxes and shipping. Payment options are offered by Affirm and are subject to an eligibility check and might not be available in all states.",ineligible:"Payment options are offered by Affirm and are subject to an eligibility check and might not be available in all states.",dynamic_pdp:'The estimated payment amount excludes taxes and shipping. Rates range from 0-36% APR. Payment options through Shop Pay Installments are subject to an eligibility check and are provided by these lending partners: affirm.com/lenders. Options depend on your purchase amount, and a down payment may be required. More options may be available upon approval. State notices to consumers: affirm.com/licenses.'}}};this._i18n=new l({[e]:t})}catch(e){e instanceof Error&&n.notify(e)}}))}attributeChangedCallback(){this._didMount&&this.updateBanner()}connectedCallback(){return o(this,void 0,void 0,(function*(){yield this.initTranslations(),this.updateBanner(),this._didMount=!0}))}isInAdaptiveRangeWithoutZeroInterest(){return this._eligible&&!this._hasZeroInterestLoanType()&&2===this._loanTypes.length&&this._loanTypes.includes(a.SplitPay)&&this._loanTypes.includes(a.Interest)}updateBanner(){try{const n=this.getAttribute("shopify-meta");if(n){const s=JSON.parse(n);this._backgroundColor=re(this.shadowRoot);const o=this._getLowestLoanTypes(s.financing_plans);this._minIneligibleMessageType=(t=o)&&(t.includes(a.Interest)&&!t.includes(a.SplitPay)||t.includes(a.ZeroPercent))?i.Monthly:i.SplitPay,Q(s,this._monorailTracker.trackInvalidInstallmentBannerMetadata.bind(this._monorailTracker))&&(s.type===e.Cart?(this._monorailTracker.trackElementImpression(e.Cart),this._metaType=e.Cart,this.handleCartOrCheckoutMeta(s)):s.type===e.Checkout?(this._monorailTracker.trackElementImpression(e.Checkout),this._metaType=e.Checkout,this.handleCartOrCheckoutMeta(s)):(this._monorailTracker.trackElementImpression(e.Product),this._metaType=e.Product,this.handleProductMeta(s))),this.updateLearnMoreButtonAndModal()}}catch(e){e instanceof TypeError&&e.message.match(ne)?console.error(e):n.notify(e,{metadata:{component:this._componentMetadata()}}),this._clearShadowRoot()}var t}_getSellerIdInNumber(){return this._sellerId?Number.parseInt(this._sellerId,10):void 0}updateLearnMoreButtonAndModal(){return o(this,void 0,void 0,(function*(){var t;const n=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("#shopify-installments-cta");if(!this._i18n||!n)return;const i=I(this,xe,"a",Se);I(this,xe,"a",qe)?n.innerHTML=this._i18n.translate("banner.prequal"):this._eligible&&i?n.innerHTML=this._i18n.translate("banner.view_sample_plans"):n.innerHTML=this._i18n.translate("banner.learn_more"),this._monorailTracker.trackInstallmentsBannerImpression(this._metaType,this._getInstallmentBannerContentType(i),this._eligible,b.Standard,I(this,xe,"a",qe),this._fullPrice,this._currentVariantId),this._metaType===e.Cart&&i&&(this._cartDetails=yield this._generateCartDetails()),I(this,xe,"m",Ie).call(this,n),I(this,xe,"a",Me)&&I(this,xe,"m",Be).call(this)}))}handleProductMeta(e){this._variants=e.variants,this._minPrice=e.min_price,this._minPriceNumber=le(this._minPrice),this._maxPrice=e.max_price,this._maxPriceNumber=le(this._maxPrice),this._currentVariantId=Number(this.getAttribute("variant-id")),this._fullPrice=this._getVariantFullPrice(this._currentVariantId),this._numberOfPaymentTerms=this._getNumberOfPaymentTermsForPDPVariant(this._currentVariantId),this._pricePerTerm=this.updatePDPVariant(this._currentVariantId,e.financing_plans),this._sellerId=e.seller_id,this._installmentsBuyerPrequalificationEnabled=e.installments_buyer_prequalification_enabled,this._buildInstallmentPlans(e.financing_plans,this._fullPrice);const t=this._getProductForm();if(t){const n=(i=0)=>{if(i>4)return;const a=ce(t);a&&(this._currentVariantId===a?setTimeout((()=>{n(i+1)}),100):(this._numberOfPaymentTerms=this._getNumberOfPaymentTermsForPDPVariant(a),this._pricePerTerm=this.updatePDPVariant(a,e.financing_plans),this._fullPrice=this._getVariantFullPrice(a),this._buildInstallmentPlans(e.financing_plans,this._fullPrice),this._currentVariantId=a,this.updateLearnMoreButtonAndModal()))};this._hasChangeEventListener||(this._hasChangeEventListener=!0,t.addEventListener("change",(()=>{n()})))}}handleCartOrCheckoutMeta(e){const t=se();this._minPrice=e.min_price,this._minPriceNumber=le(this._minPrice),this._maxPrice=e.max_price,this._maxPriceNumber=le(this._maxPrice),this._fullPrice=e.full_price,this._loanTypes=this._getAvailableLoanTypes(this._fullPrice,e.financing_plans),this._eligible=e.eligible,this._financingTermForBanner=this.getFinancingTermForCart(this._fullPrice,e.financing_plans),this._sellerId=e.seller_id,this._installmentsBuyerPrequalificationEnabled=e.installments_buyer_prequalification_enabled,this._pricePerTerm=this._financingTermForBanner?this.getCartPricePerTerm(this._fullPrice,this._financingTermForBanner):e.price_per_term,this._numberOfPaymentTerms=this._financingTermForBanner?this._financingTermForBanner.installments_count:e.number_of_payment_terms,this.updateBannerPrice(this._pricePerTerm),this._loanTypes.length&&this._buildInstallmentPlans(e.financing_plans,e.full_price),t||oe();new MutationObserver((e=>{e.forEach((e=>{if(e.target.nodeType!==Node.ELEMENT_NODE)return;const n=e.target;if((n.matches("[data-cart-subtotal]")||t&&n.matches(t))&&n.textContent){const e=le(n.textContent);if(e){this._fullPrice=n.textContent,this._eligible=this._priceEligible(e);const t=this._splitCartPrice(e);if(t){const e=ae(t);this._pricePerTerm=e,this.updateBannerPrice(e)}}}}))})).observe(document,{attributes:!0,childList:!0,subtree:!0})}buildVariantInfo(e){return{idQuantityMapping:`${this._currentVariantId}:${e}`,available:this._variantAvailable}}getCartPricePerTerm(e,t){const n=le(e);return this.calculatePricePerTerm(n,t)}getFinancingTermForCart(e,t){const n=le(e),i=this._getFinancingPlanForPrice(n,t);if(i)return this._getFinancingTermForBanner(i)}_getVariantFullPrice(e){var t;const n=null===(t=this._variants)||void 0===t?void 0:t.find((t=>Number(t.id)===e));return null==n?void 0:n.full_price}_getNumberOfPaymentTermsForPDPVariant(e){var t;const n=null===(t=this._variants)||void 0===t?void 0:t.find((t=>Number(t.id)===e));return(null==n?void 0:n.number_of_payment_terms)||4}_generateCartDetails(){return o(this,void 0,void 0,(function*(){const e=F(window.location.origin);if(e)return O(e)}))}_getLowestLoanTypes(e){const t=e?e[0]:null;if(!t)return[];return t.terms.map((e=>e.loan_type===a.SplitPay?a.SplitPay:0===e.apr?a.ZeroPercent:a.Interest))}_getFinancingPlanForPrice(e,t){return t.find((t=>{const n=le(t.min_price),i=le(t.max_price);return e>=n&&e<=i}))}_getFinancingTermForBanner(e){const t=e.terms.reduce(((e,t)=>t.installments_count>e.installments_count?t:e));if(this._hasZeroInterestLoanType())return t;const n=e.terms.find((e=>e.loan_type===a.SplitPay));return n&&!this.isInAdaptiveRangeWithoutZeroInterest()?n:t}_buildInstallmentPlans(e,t){if(!t)return;const n=le(t),i=this._getFinancingPlanForPrice(n,e);i&&(this._installmentPlans=this._getSampleDisplayedTerms(i.terms).map((e=>({pricePerTerm:this.calculatePricePerTerm(n,e),apr:e.apr,numberOfPaymentTerms:e.installments_count,loanType:e.loan_type}))))}_getSampleDisplayedTerms(e){if(e.length<3)return e;if(this.isInAdaptiveRangeWithoutZeroInterest())return[e[0],e[e.length-1]];const t=e.filter((e=>e.loan_type!==a.SplitPay));return t.length<3?t:[t[0],t[t.length-1]]}_splitCartPrice(e){if(!isNaN(e))return Math.floor(e/this._numberOfPaymentTerms*100)/100}_priceEligible(e){return null!=this._minPriceNumber&&null!=this._maxPriceNumber&&e>=this._minPriceNumber&&e<=this._maxPriceNumber}_instrumentMonorailModalOpenEvent(e,t){e instanceof be?this._modalMonorailTracker.trackModalOpened(t,e.getModalToken(),e.getModalType(),JSON.stringify([]),this._currentVariantId,this._fullPrice):this._modalMonorailTracker.trackModalOpened(t,e.getModalToken(),e.getModalType(),JSON.stringify(e.getModalSamplePlans()),this._currentVariantId,this._fullPrice,e.getPermalink())}_getInstallmentBannerContentType(e){return e?this.isInAdaptiveRangeWithoutZeroInterest()?f.PayInFourAsLowAs:f.AsLowAs:f.PayInFour}_hasZeroInterestLoanType(){return this._loanTypes.includes(a.ZeroPercent)}_getAvailableLoanTypes(e,t){if(!t||0===t.length||!e)return[];const n=le(e),i=this._getFinancingPlanForPrice(n,t);if(!i)return[];const s=new Set;return i.terms.forEach((e=>{e.loan_type===a.SplitPay?s.add(a.SplitPay):0===e.apr?s.add(a.ZeroPercent):s.add(a.Interest)})),Array.from(s)}_getProductForm(){var e,t,n;return null===(n=null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.host.parentNode)||void 0===t?void 0:t.host)||void 0===n?void 0:n.closest("form")}_clearShadowRoot(){this.shadowRoot&&(this.shadowRoot.innerHTML="")}_componentMetadata(){return{name:"shop-pay-installments-banner",shopifyMeta:this.getAttribute("shopify-meta"),variantId:this.getAttribute("variant-id")}}}xe=new WeakSet,Ie=function(t){var n;const i=()=>o(this,void 0,void 0,(function*(){const n=y();if(!this._pricePerTerm)return;const i=this._getProductForm(),a=this._metaType===e.Product?function(e){if(!e)return 1;const t=e.elements.quantity;if(t)return Number(t.value);const n=e.getAttribute("id"),i=null==n?void 0:n.replace("product-form-installment-",""),a=document.getElementById(`Quantity-${i}`);return a?Number(a.value):1}(i):void 0;if(!this._open){this._open=!0,this._modalMonorailTracker.trackElementImpression(this._metaType);const e={minPrice:this._minPrice,maxPrice:this._maxPrice},i=a?this.buildVariantInfo(a):void 0;let s;this._installmentsBuyerPrequalificationEnabled&&this._eligible?(s=new Fe(n,this._modalMonorailTracker,this._loanTypes,this._eligible,this._installmentPlans||[],this._fullPrice||"",this._sellerId,i,this._cartDetails,this._analyticsTraceId),this._modalMonorailTracker.trackInstallmentsBannerPrequalInteraction(this._metaType,this._getInstallmentBannerContentType(!1),this._eligible,this._fullPrice||"",!0)):s=I(this,xe,"a",Se)?new Pe(n,this._modalMonorailTracker,this._installmentPlans||[],this._fullPrice||"",this._metaType,i,this._cartDetails):new be(this._pricePerTerm,this._eligible,e,this._loanTypes,n,this._modalMonorailTracker,this._fullPrice,this._minIneligibleMessageType,this._numberOfPaymentTerms),yield s.connectedCallback();const o=new ie(s.focusLockTarget);s.addEventListener("shopify_modal_close",(()=>{this._open=!1,ve(),o.release(t)})),this._installmentsBuyerPrequalificationEnabled&&this._modalMonorailTracker.trackInstallmentsPrequalPopupPageImpression(this._getSellerIdInNumber(),P.IntroPageLoaded),ge(s),this._instrumentMonorailModalOpenEvent(s,this._metaType),o.lock()}}));this._lastLearnMoreEventListener.has(t)&&(null===(n=this._lastLearnMoreEventListener.get(t))||void 0===n||n()),this._lastLearnMoreEventListener.set(t,(()=>t.removeEventListener("click",i))),t.addEventListener("click",i)},Se=function(){var e;const t=1===this._loanTypes.length&&this._loanTypes[0]===a.Interest,n=(null===(e=this._installmentPlans)||void 0===e?void 0:e.length)&&this._fullPrice&&(this._hasZeroInterestLoanType()||t||this.isInAdaptiveRangeWithoutZeroInterest());return Boolean(n)},qe=function(){return Boolean(this._eligible&&this._installmentsBuyerPrequalificationEnabled)},Me=function(){return Boolean(this._fullPrice&&this._eligible&&le(this._fullPrice)>=50)},Ee=function(){return Boolean(this._fullPrice&&le(this._fullPrice)<150)},Ae=function(){const e=this.shadowRoot.querySelector(".shopify-installments__prequal-row");if(!e)return;const t=window.getComputedStyle(e);return{color:t.color,fontSize:t.fontSize,fontFamily:t.fontFamily,letterSpacing:t.letterSpacing,fontFace:fe(t.fontFamily)}},Be=function(){var e,t,n,i,a;const s=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("#shopify-installments-cta"),o=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("#shopifyPrequalifiedCTA"),r=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector("#prequalAmountRowWrapper");let l=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector("#prequalAmount");l||(l=document.createElement("shop-prequal-amount"),l.setAttribute("id","prequalAmount"),null===(a=o.parentNode)||void 0===a||a.insertBefore(l,o)),o&&this._i18n&&(o.innerHTML=I(this,xe,"a",Ee)?this._i18n.translate("banner.learn_more"):this._i18n.translate("banner.prequal_contents.prequalified_see_plans"),I(this,xe,"m",Ie).call(this,o),l.onloaded=()=>null==r?void 0:r.classList.remove("stable"),l.styles=()=>I(this,xe,"m",Ae).call(this),l.onready=(e,t)=>{var n;if(e){if(!t){const e=null===(n=this.shadowRoot)||void 0===n?void 0:n.querySelector("#shopify-installments");null==e||e.classList.add("default-font")}s.tabIndex=-1,o.tabIndex=0,requestAnimationFrame((()=>{null==r||r.classList.add("is-prequalified"),setTimeout((()=>null==r?void 0:r.classList.add("stable")),300)}))}})};const Re=`\n\n
\n \n

We need a bit more information.
\n Click continue and a new tab will open so you can provide your information securely.

\n Continue\n
\n`;var Ne,ze,Ve;class $e extends N{constructor(){super(),Ne.add(this),ze.set(this,void 0),customElements.get("shop-pay-logo")||customElements.define("shop-pay-logo",_)}connectedCallback(){const e=document.createElement("template");e.innerHTML=Re,this.attachShadow({mode:"open"}).append(e.content.cloneNode(!0)),I(this,Ne,"m",Ve).call(this)}disconnectedCallback(){var e;null===(e=this._popupListener)||void 0===e||e.destroy(),this._popupListener=void 0}attributeChangedCallback(){}handlePostMessage(e){var t,n,i;"close"===e.type&&(null===(t=I(this,ze,"f"))||void 0===t||t.close(),this.dispatchCustomEvent("overlayClose")),"prequal_buyer_upsert_successful"===e.type&&(null===(n=I(this,ze,"f"))||void 0===n||n.close(),this.dispatchCustomEvent("buyerOnboardingSuccess")),"error"===e.type&&(null===(i=I(this,ze,"f"))||void 0===i||i.close(),this.dispatchCustomEvent("closeOverlayAndModal"))}handleContinueButtonClick(){if(I(this,ze,"f")&&!I(this,ze,"f").closed)I(this,ze,"f").focus(),this.addPostMessageEventListener();else{const e=`${D()}/shopify_pay/prequal_authorize?target_origin=${window.location.origin}`;z(this,ze,V({url:e,width:500,height:750}),"f"),I(this,ze,"f")&&(I(this,ze,"f").focus(),this.addPostMessageEventListener())}}addPostMessageEventListener(){I(this,ze,"f")&&(this._popupListener=new M(new $(I(this,ze,"f")),[w],this.handlePostMessage.bind(this)))}}var We,je,He,Ze,De,Ue,Ye,Je,Qe,Ke,Ge,Xe,et,tt,nt,it,at,st,ot,rt,lt,ct,pt;ze=new WeakMap,Ne=new WeakSet,Ve=function(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("#installments-prequal-overlay-continue");t&&(t.onclick=()=>{this.handleContinueButtonClick()})};var ht;!function(e){e.Unspecified="unspecified",e.PrequalAmount="prequalAmount"}(ht||(ht={}));class mt extends W{constructor(e){super(e,[w,E])}}const dt=new WeakMap;class ut extends N{constructor(){var e;super(),We.add(this),je.set(this,null),He.set(this,void 0),Ze.set(this,"loading"),De.set(this,void 0),Ue.set(this,void 0),Ye.set(this,void 0),Je.set(this,void 0),Qe.set(this,void 0),Ke.set(this,void 0),Ge.set(this,void 0),Xe.set(this,{shopPayInstallmentsOnboarded:!1,fontLoaded:!1}),z(this,He,this.getAttribute(L)||x(),"f");const t=document.createElement("template");t.innerHTML="\n \n\n
\n
\n ",dt.set(this,this.attachShadow({mode:"open"})),null===(e=dt.get(this))||void 0===e||e.appendChild(t.content.cloneNode(!0))}set styles(e){z(this,De,e,"f"),I(this,We,"m",et).call(this)}get styles(){return I(this,De,"f")}set onready(e){z(this,Ue,e,"f")}get onready(){return I(this,Ue,"f")}set onloaded(e){z(this,Ye,e,"f")}get onloaded(){return I(this,Ye,"f")}connectedCallback(){return o(this,void 0,void 0,(function*(){I(this,We,"m",ot).call(this),yield I(this,We,"m",at).call(this),I(this,We,"m",rt).call(this),I(this,We,"m",ct).call(this)}))}attributeChangedCallback(e,t,n){this.updateAttribute(e,n||void 0)}disconnectedCallback(){I(this,We,"m",pt).call(this),I(this,We,"m",ot).call(this)}handlePostMessage(e){var t;switch(I(this,We,"m",tt).call(this),e.type){case"custom_flow_side_effect":z(this,Ze,"confirmed","f"),z(this,Xe,{shopPayInstallmentsOnboarded:Boolean(e.shopPayInstallmentsOnboarded),fontLoaded:Boolean(e.fontAssetLoaded)},"f"),I(this,We,"m",st).call(this);break;case"error":I(this,We,"m",nt).call(this);break;case"loaded":"loading"===I(this,Ze,"f")&&(z(this,Ze,"loaded","f"),null===(t=I(this,Ye,"f"))||void 0===t||t.call(this),I(this,We,"m",et).call(this));break;case"resize_iframe":I(this,Je,"f").style.height=`${e.height}px`,I(this,Je,"f").style.width=`${e.width}px`,"confirmed"===I(this,Ze,"f")&&I(this,We,"m",it).call(this,I(this,Xe,"f").shopPayInstallmentsOnboarded,I(this,Xe,"f").fontLoaded)}}}je=new WeakMap,He=new WeakMap,Ze=new WeakMap,De=new WeakMap,Ue=new WeakMap,Ye=new WeakMap,Je=new WeakMap,Qe=new WeakMap,Ke=new WeakMap,Ge=new WeakMap,Xe=new WeakMap,We=new WeakSet,et=function(){var e;if("loaded"===I(this,Ze,"f")&&I(this,De,"f")){const t=I(this,De,"f").call(this);t&&(null===(e=I(this,Ke,"f"))||void 0===e||e.postMessage({type:"setcomponentstyle",style:t}))}},tt=function(){I(this,Ge,"f")&&(clearTimeout(I(this,Ge,"f")),z(this,Ge,void 0,"f"))},nt=function(){var e;z(this,Ze,"error","f"),I(this,We,"m",ot).call(this),null===(e=I(this,Ue,"f"))||void 0===e||e.call(this,!1,!1)},it=function(e,t){var n;"error"!==I(this,Ze,"f")&&(z(this,Ze,"ready","f"),e?I(this,We,"m",st).call(this):I(this,We,"m",ot).call(this),null===(n=I(this,Ue,"f"))||void 0===n||n.call(this,e,Boolean(t)))},at=function(){return o(this,void 0,void 0,(function*(){if(!I(this,je,"f"))try{const e=l.getDefaultLanguage(),t={affirm:"Affirm",shopPay:"Shop Pay",banner:{learn_more:"Learn more",view_sample_plans:"View sample plans",prequal:"Check your purchasing power",split_pay_eligible:"Pay in 4 interest-free installments of {price} with {shopPayLogo}",split_pay_eligible_2:"Pay in 2 interest-free installments of {price} with {shopPayLogo}",split_pay_eligible_30:"Pay {price} within 30 days interest-free with {shopPayLogo}",interest_only_eligible:"Split your purchase into monthly installments with {shopPayLogo}",dynamic_interest_only_eligible:"From {price}/mo with {shopPayLogo}",pay_in_4_or_as_low_as_eligible:"4 interest-free installments, or from {price}/mo with {shopPayLogo}",zero_interest_eligible:"From {price}/mo or 0% APR with {shopPayLogo}",zero_interest_eligible_zero_apr:"From {price}/mo at 0% APR with {shopPayLogo}",non_eligible_min:"Pay in 4 interest-free installments for orders over {minPrice} with {shopPayLogo}",non_eligible_min_over_time:"Pay over time for orders over {minPrice} with {shopPayLogo}",non_eligible_min_over_time_30:"Pay within 30 days interest-free for orders over {minPrice} with {shopPayLogo}",non_eligible_monthly_payments_min:"Split your purchase into monthly installments for orders over {minPrice} with {shopPayLogo}",non_eligible_max:"Split your purchase into installments for orders up to {maxPrice} with {shopPayLogo}",prequal_contents:{not_prequalified_see_plans:"Check your purchasing power",prequalified_see_plans:"See plans",purchasing_power_a:"Your purchasing power is ",purchasing_power_b:"Spend any amount up to "}},modal:{title:"Get it now, pay later",subtitle:{interest_and_split_pay:'Choose your payment schedule at checkout – starting at 4 interest-free payments of {splitPayLoanRepayment} every 2 weeks.',interest_only:"Choose your payment schedule at checkout to split your purchase into monthly installments.",split_pay_only:'Select installments at checkout to split your purchase into 4 interest-free payments of {splitPayLoanRepayment} every 2 weeks.',split_pay_only_2:'Select installments at checkout to split your purchase into 2 interest-free payments of {splitPayLoanRepayment} every 15 days.',split_pay_only_30:"Select installments at checkout to pay for your purchase of {price} interest-free within 30 days.",ineligible_min:"For orders over {minPrice}, select installments at checkout to split your purchase into 4 interest-free payments.",ineligible_min_over_time:"For orders over {minPrice}, select installments at checkout to split your purchase over time.",ineligible_monthly_payments_min:"For orders over {minPrice}, select installments at checkout to split your purchase into monthly payments.",ineligible_max:"For orders up to {maxPrice}, select installments at checkout to split your purchase into multiple payments.",dynamic_pdp:{one:"Sample plan for {priceWithoutInterest} purchase",other:"Sample plans for {priceWithoutInterest} purchase"}},close:"Close",new_window:"Opens in a new window.",partnership:"Installments in partnership with {affirmLogo}",partnership_disclaimer:"Installments in partnership with {affirmLogo}. Translation services are not provided by Affirm. Affirm and its offerings are only supported in English.",split_pay_contents:{interest_fees:"No hidden fees, ever.",interest_credit:"No impact on your credit score to apply.",no_interest_fees:"No fees, ever.",no_interest_credit:"No impact on your credit score to apply."},sample_plan_contents:{continue_to_checkout:"Continue to checkout",unavailable:"Unavailable",check_eligibility:"By continuing, your information will be shared with Affirm.
Checking your qualification won’t affect your credit. ",apr:"APR",interest:"Interest",total:"Total",processing:"Processing your request",processing_time:"This can take up to a minute...",split_pay_frequency:'{pricePerTerm}  every 2 weeks',other_frequency:'{pricePerTerm}  every month',split_pay_number_of_terms:" for {numberOfTerms} weeks",other_number_of_terms:" for {numberOfTerms} months"},prequal_contents:{unavailable:"Unavailable",check:"Check if you qualify"},legal:{ca_residents_notice:"CA Residents: Loans by Affirm Loan Services, LLC are made or arranged pursuant to a California Finance Lender license.",rates_from_apr:'Rates from 0-36% APR. Payment options through Affirm are subject to an eligibility check, may not be available in all states, and are provided by these lending partners: affirm.com/lenders. Options depend on your purchase amount, and a down payment may be required.',interest_and_split_pay:"The estimated payment amount excludes taxes and shipping.",split_pay_only:"The estimated payment amount excludes taxes and shipping. Payment options are offered by Affirm and are subject to an eligibility check and might not be available in all states.",ineligible:"Payment options are offered by Affirm and are subject to an eligibility check and might not be available in all states.",dynamic_pdp:'The estimated payment amount excludes taxes and shipping. Rates range from 0-36% APR. Payment options through Shop Pay Installments are subject to an eligibility check and are provided by these lending partners: affirm.com/lenders. Options depend on your purchase amount, and a down payment may be required. More options may be available upon approval. State notices to consumers: affirm.com/licenses.'}}};z(this,je,new l({[e]:t}),"f")}catch(e){e instanceof Error&&n.notify(e)}}))},st=function(){this.style.display=""},ot=function(){this.style.display="none"},rt=function(){var e;if(!I(this,je,"f"))return;const t=null===(e=dt.get(this))||void 0===e?void 0:e.querySelector(".container"),n=I(this,je,"f").translate("banner.prequal_contents.purchasing_power_a"),i=document.createTextNode(n),a=document.createElement("span");a.appendChild(i),t.innerHTML="",t.appendChild(a)},lt=function(){return U({version:"2",analyticsTraceId:I(this,He,"f"),analyticsContext:B.Prequal,isCompactLayout:!1,flow:A.Prequal,flowVersion:ht.PrequalAmount,signUpEnabled:!1,avoidPayAltDomain:!1,avoidSdkSession:!1,hideCopy:!0,requireVerification:!1})},ct=function(){var e,t,n;z(this,Je,document.createElement("iframe"),"f"),z(this,Ge,setTimeout((()=>{I(this,We,"m",nt).call(this)}),15e3),"f"),I(this,Je,"f").src=I(this,We,"m",lt).call(this),null===(t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".container"))||void 0===t||t.appendChild(I(this,Je,"f")),I(this,Qe,"f")||z(this,Qe,new M(new S(I(this,Je,"f")),[w,E,window.location.origin],this.handlePostMessage.bind(this),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0),"f"),I(this,Ke,"f")||z(this,Ke,new mt(I(this,Je,"f")),"f")},pt=function(){var e;null===(e=I(this,Qe,"f"))||void 0===e||e.destroy()},j()&&(H({bundle:"paymentTerms",bundleLocale:"en"}),Z(),t("shopify-payment-terms",K),t("shop-pay-banner",we),t("shop-prequal-amount",ut),t("shop-pay-installments-banner",Oe),t("installments-prequal-overlay-modal",$e)); //# sourceMappingURL=client.payment-terms_CXNNgMn-.en.esm.js.map